summaryrefslogtreecommitdiffstats
path: root/drivers/input/tsdev.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-06-04 05:29:36 +0200
committerDmitry Torokhov <dtor@insightbb.com>2007-06-04 05:50:05 +0200
commit1dfa2812404c37d7571622195f907cea3331616c (patch)
tree2533af73ff0e1e4d24603967bd6cdc092973dce9 /drivers/input/tsdev.c
parentInput: ucb1x00 - do not access input_dev->private directly (diff)
downloadlinux-1dfa2812404c37d7571622195f907cea3331616c.tar.xz
linux-1dfa2812404c37d7571622195f907cea3331616c.zip
Input: reduce raciness when input handlers disconnect
There is a race between input handler's release() and disconnect() methods: when input handler disconnects it wakes up all regular users and then process to walk user list to wake up async. users. While disconnect() walks the list release() removes elements of the same list causing oopses. While this is not a substibute for proper locking we can reduce odds of getting an oops if we wake up normal readers after walking the list. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tsdev.c')
-rw-r--r--drivers/input/tsdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c
index 5e5b5c91d75b..af4581d00d82 100644
--- a/drivers/input/tsdev.c
+++ b/drivers/input/tsdev.c
@@ -477,9 +477,9 @@ static void tsdev_disconnect(struct input_handle *handle)
if (tsdev->open) {
input_close_device(handle);
- wake_up_interruptible(&tsdev->wait);
list_for_each_entry(client, &tsdev->client_list, node)
kill_fasync(&client->fasync, SIGIO, POLL_HUP);
+ wake_up_interruptible(&tsdev->wait);
} else
tsdev_free(tsdev);
}