aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid
diff options
context:
space:
mode:
authorPeter Waechtler <pwaechtler@mac.com>2011-04-28 14:53:58 -0400
committerJiri Kosina <jkosina@suse.cz>2011-04-29 07:53:53 -0400
commit06268b2a384ece73618c1ad7649d19905ab79806 (patch)
treeda225fd98a899a22959d78ffd80a86d8009ed3dd /drivers/hid/usbhid
parent35dca5b4a67a93bbb75c2753d6dc432dc8f82e5d (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')
-rw-r--r--drivers/hid/usbhid/hiddev.c4
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);