Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-2.6.git] / drivers / input / mousedev.c
index 8675f95093935069718d6fe8cf49d8c80ac1fbd9..3f4866d8d18c85a8dae983273ba578e2e1df3d8f 100644 (file)
@@ -766,9 +766,9 @@ static void mousedev_disconnect(struct input_handle *handle)
 
        if (mousedev->open) {
                input_close_device(handle);
 
        if (mousedev->open) {
                input_close_device(handle);
-               wake_up_interruptible(&mousedev->wait);
                list_for_each_entry(client, &mousedev->client_list, node)
                        kill_fasync(&client->fasync, SIGIO, POLL_HUP);
                list_for_each_entry(client, &mousedev->client_list, node)
                        kill_fasync(&client->fasync, SIGIO, POLL_HUP);
+               wake_up_interruptible(&mousedev->wait);
        } else
                mousedev_free(mousedev);
 }
        } else
                mousedev_free(mousedev);
 }