提交 df69f8e5 编写于 作者: O Oliver Neukum 提交者: Xie XiuQi

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

[ Upstream commit 11a087f4 ]

We need to check whether this work we are canceling actually is
initialized.
Signed-off-by: NOliver Neukum <oneukum@suse.com>
Reported-by: syzbot+2e1ef9188251d9cc7944@syzkaller.appspotmail.com
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 db3e7b4e
...@@ -2350,6 +2350,8 @@ void uvc_ctrl_cleanup_device(struct uvc_device *dev) ...@@ -2350,6 +2350,8 @@ void uvc_ctrl_cleanup_device(struct uvc_device *dev)
struct uvc_entity *entity; struct uvc_entity *entity;
unsigned int i; unsigned int i;
/* Can be uninitialized if we are aborting on probe error. */
if (dev->async_ctrl.work.func)
cancel_work_sync(&dev->async_ctrl.work); cancel_work_sync(&dev->async_ctrl.work);
/* Free controls and control mappings for all entities. */ /* Free controls and control mappings for all entities. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册