aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2015-04-09 07:32:35 -0400
committerJiri Kosina <jkosina@suse.cz>2015-04-10 11:32:21 -0400
commit8fec02a73e31407e14986fca67dab48d4f777f0e (patch)
tree8cae498d507f63e429c7e528f6332f6f998b3a47 /drivers/hid
parentc627589282213bbef12a482c0b87f23526ceb3f0 (diff)
HID: debug: fix error handling in hid_debug_events_read()
In the unlikely case of hdev vanishing while hid_debug_events_read() was sleeping, we can't really break out of the case switch as with other cases, as on the way out we'll try to remove ourselves from the hdev waitqueue. Fix this by taking a shortcut exit path and avoiding cleanup that doesn't make sense in case hdev doesn't exist any more anyway. Reported-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 8bf61d295ffd..f5021fb3b674 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -1127,7 +1127,8 @@ static ssize_t hid_debug_events_read(struct file *file, char __user *buffer,
1127 1127
1128 if (!list->hdev || !list->hdev->debug) { 1128 if (!list->hdev || !list->hdev->debug) {
1129 ret = -EIO; 1129 ret = -EIO;
1130 break; 1130 set_current_state(TASK_RUNNING);
1131 goto out;
1131 } 1132 }
1132 1133
1133 /* allow O_NONBLOCK from other threads */ 1134 /* allow O_NONBLOCK from other threads */