]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: debug: fix error handling in hid_debug_events_read()
authorJiri Kosina <jkosina@suse.cz>
Thu, 9 Apr 2015 11:32:35 +0000 (13:32 +0200)
committerJiri Slaby <jslaby@suse.cz>
Tue, 26 May 2015 14:26:56 +0000 (16:26 +0200)
commit7b40fa9889ad0e2b54e5419b1e3a01ff6ab85f16
tree13367c7f126a5f0e28cbbde073e60c9d0052194a
parentef18ea6b22587c3778cc71e67a0297ebb0660f65
HID: debug: fix error handling in hid_debug_events_read()

commit 8fec02a73e31407e14986fca67dab48d4f777f0e upstream.

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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/hid/hid-debug.c