]> git.baikalelectronics.ru Git - kernel.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)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 16 Oct 2019 19:33:58 +0000 (16:33 -0300)
commit168dfd9e86fdb9e823fb9ea994b96de93c6b13cc
treef2aa9f45b2bcf513a8e5ca7ecd27a1fd9ff84afa
parentcf0c98edd75ba3a8eacce267c8ecaabcfa9f54f8
media: uvcvideo: Fix error path in control parsing failure

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: 0227e963d170 ("[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>
drivers/media/usb/uvc/uvc_driver.c