Input: fix list iteration in input_release_device()
authorAndrew Morton <akpm@osdl.org>
Sat, 15 Jul 2006 05:17:38 +0000 (01:17 -0400)
committerDmitry Torokhov <dtor@insightbb.com>
Sat, 15 Jul 2006 05:17:38 +0000 (01:17 -0400)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/input.c

index e20913942927446ef857c238c7709837ffcfb02e..9c98b6d6848b2a465d3575cddcd7e13f3569407d 100644 (file)
@@ -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);
        }