]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: uvcvideo: Fix error path in control parsing failure
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 30 Jul 2019 02:14:55 +0000 (23:14 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2019 09:10:15 +0000 (10:10 +0100)
commitfc12e3da6ac8d8ff7869ac1d40baeca1312808eb
treed61303e7482946fed55aceb56f3269c3bd6507de
parentfc3b55ef2c840bb2746b2d8121a0788de84f7fac
media: uvcvideo: Fix error path in control parsing failure

commit 8c279e9394cade640ed86ec6c6645a0e7df5e0b6 upstream.

When parsing the UVC control descriptors fails, the error path tries to
cleanup a media device that hasn't been initialised, potentially
resulting in a crash. Fix this by initialising the media device before
the error handling path can be reached.

Fixes: 5a254d751e52 ("[media] uvcvideo: Register a v4l2_device")
Reported-by: syzbot+c86454eb3af9e8a4da20@syzkaller.appspotmail.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/uvc/uvc_driver.c