diff options
author | Peter Waechtler <pwaechtler@mac.com> | 2011-04-28 14:53:58 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-04-29 07:53:53 -0400 |
commit | 06268b2a384ece73618c1ad7649d19905ab79806 (patch) | |
tree | da225fd98a899a22959d78ffd80a86d8009ed3dd /drivers/hid/usbhid/hiddev.c | |
parent | 35dca5b4a67a93bbb75c2753d6dc432dc8f82e5d (diff) |
HID: hiddev: fix error path in hiddev_read when interrupted
hiddev_read: in case mutex_lock_interruptible will be interrupted
remove the task from the wait queue.
Signed-off-by: Peter Waechtler <pwaechtler@mac.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid/hiddev.c')
-rw-r--r-- | drivers/hid/usbhid/hiddev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index af0a7c1002af..891ff531cf34 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
@@ -367,8 +367,10 @@ static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t coun | |||
367 | /* let O_NONBLOCK tasks run */ | 367 | /* let O_NONBLOCK tasks run */ |
368 | mutex_unlock(&list->thread_lock); | 368 | mutex_unlock(&list->thread_lock); |
369 | schedule(); | 369 | schedule(); |
370 | if (mutex_lock_interruptible(&list->thread_lock)) | 370 | if (mutex_lock_interruptible(&list->thread_lock)) { |
371 | finish_wait(&list->hiddev->wait, &wait); | ||
371 | return -EINTR; | 372 | return -EINTR; |
373 | } | ||
372 | set_current_state(TASK_INTERRUPTIBLE); | 374 | set_current_state(TASK_INTERRUPTIBLE); |
373 | } | 375 | } |
374 | finish_wait(&list->hiddev->wait, &wait); | 376 | finish_wait(&list->hiddev->wait, &wait); |