mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
HID: hiddev: do cleanup in failure of opening a device
commit 6d4472d7be upstream.
Undo what we did for opening before releasing the memory slice.
Reported-by: syzbot <syzbot+62a1e04fd3ec2abf099e@syzkaller.appspotmail.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4239114d88
commit
d65ca54d05
@@ -321,6 +321,10 @@ bail_normal_power:
|
||||
hid_hw_power(hid, PM_HINT_NORMAL);
|
||||
bail_unlock:
|
||||
mutex_unlock(&hiddev->existancelock);
|
||||
|
||||
spin_lock_irq(&list->hiddev->list_lock);
|
||||
list_del(&list->node);
|
||||
spin_unlock_irq(&list->hiddev->list_lock);
|
||||
bail:
|
||||
file->private_data = NULL;
|
||||
vfree(list);
|
||||
|
||||
Reference in New Issue
Block a user