summaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid
diff options
context:
space:
mode:
authorPeter Waechtler <pwaechtler@mac.com>2011-04-28 20:53:58 +0200
committerJiri Kosina <jkosina@suse.cz>2011-04-29 13:53:53 +0200
commit06268b2a384ece73618c1ad7649d19905ab79806 (patch)
treeda225fd98a899a22959d78ffd80a86d8009ed3dd /drivers/hid/usbhid
parent35dca5b4a67a93bbb75c2753d6dc432dc8f82e5d (diff)
downloadop-kernel-dev-06268b2a384ece73618c1ad7649d19905ab79806.zip
op-kernel-dev-06268b2a384ece73618c1ad7649d19905ab79806.tar.gz
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 af0a7c1..891ff53 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
/* let O_NONBLOCK tasks run */
mutex_unlock(&list->thread_lock);
schedule();
- if (mutex_lock_interruptible(&list->thread_lock))
+ if (mutex_lock_interruptible(&list->thread_lock)) {
+ finish_wait(&list->hiddev->wait, &wait);
return -EINTR;
+ }
set_current_state(TASK_INTERRUPTIBLE);
}
finish_wait(&list->hiddev->wait, &wait);
OpenPOWER on IntegriCloud