From: Andrew Morton Date: Sat, 15 Jul 2006 05:17:38 +0000 (-0400) Subject: Input: fix list iteration in input_release_device() X-Git-Tag: v2.6.18-rc4~1^2~16 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2b2ed2ce20ae6c335a27ae5bf8580f385014e70;p=linux-2.6 Input: fix list iteration in input_release_device() Signed-off-by: Andrew Morton Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/input.c b/drivers/input/input.c index e209139429..9c98b6d684 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -236,10 +236,12 @@ EXPORT_SYMBOL(input_grab_device); void input_release_device(struct input_handle *handle) { - if (handle->dev->grab == handle) { - handle->dev->grab = NULL; + struct input_dev *dev = handle->dev; + + if (dev->grab == handle) { + dev->grab = NULL; - list_for_each_entry(handle, &handle->dev->h_list, d_node) + list_for_each_entry(handle, &dev->h_list, d_node) if (handle->handler->start) handle->handler->start(handle); }