[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)
committerJan Altensen <info@stricted.net>
Sun, 14 Jun 2020 09:30:24 +0000 (11:30 +0200)
commit893e42691ad720849dc8d9a619f33685fb084732
treed8907893f2e567f1a6a914711120c67214c97d76
parent7f86dc5927ce0b1696439dea23bf080584729cc4
[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>
(cherry picked from commit 3de515c380203c6984f3d227ae26b86a88c4a6cb)
drivers/hid/usbhid/hiddev.c