[RAMEN9610-21380]HID: hiddev: do cleanup in failure of opening a device
authorHillf Danton <hdanton@sina.com>
Tue, 6 Aug 2019 08:40:15 +0000 (16:40 +0800)
committerlingsen1 <lingsen1@lenovo.com>
Wed, 19 Feb 2020 01:38:43 +0000 (09:38 +0800)
commit8baf465f2446f636c55d6815f277563ad30d40f1
treed36edffe9ea917f92df00e616f017f1efe10db1f
parenta910e0664e3ff169e24d80936b7d0ed69ae44a13
[RAMEN9610-21380]HID: hiddev: do cleanup in failure of opening a device

commit 6d4472d7bec39917b54e4e80245784ea5d60ce49 upstream.

Undo what we did for opening before releasing the memory slice.

Change-Id: I0af2538257801d16761dd60e5eaeeb448e6a7aa4
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>
drivers/hid/usbhid/hiddev.c