Commit 11a087f4 authored by Oliver Neukum's avatar Oliver Neukum Committed by Mauro Carvalho Chehab

media: uvcvideo: Fix access to uninitialized fields on probe error

We need to check whether this work we are canceling actually is
initialized.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Reported-by: syzbot+2e1ef9188251d9cc7944@syzkaller.appspotmail.com
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 675e2f20
...@@ -2345,7 +2345,9 @@ void uvc_ctrl_cleanup_device(struct uvc_device *dev) ...@@ -2345,7 +2345,9 @@ void uvc_ctrl_cleanup_device(struct uvc_device *dev)
struct uvc_entity *entity; struct uvc_entity *entity;
unsigned int i; unsigned int i;
cancel_work_sync(&dev->async_ctrl.work); /* Can be uninitialized if we are aborting on probe error. */
if (dev->async_ctrl.work.func)
cancel_work_sync(&dev->async_ctrl.work);
/* Free controls and control mappings for all entities. */ /* Free controls and control mappings for all entities. */
list_for_each_entry(entity, &dev->entities, list) { list_for_each_entry(entity, &dev->entities, list) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment