mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
usb: gadget: uvc: Fix null pointer dereference in uvcg_video_init()
In uvcg_video_init(), if kthread_run_worker() fails,
the error logged uses uvcg_err(), however, the pointer it uses:
video->uvc is not assigned at this point, triggering a null
pointer dereference. Fix this by directly using uvc->func which
is assigned already.
Reported-by: syzbot+8dcac923582c28505fd7@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=8dcac923582c28505fd7
Fixes: f0bbfbd16b ("usb: gadget: uvc: rework to enqueue in pump worker from encoded queue")
Cc: stable@vger.kernel.org
Signed-off-by: Jeffin Philip <jeffinphilip14@gmail.com>
Reviewed-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://patch.msgid.link/20260804034338.7976-1-jeffinphilip14@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
92090f6ff2
commit
5b1da38592
|
|
@ -821,7 +821,7 @@ int uvcg_video_init(struct uvc_video *video, struct uvc_device *uvc)
|
|||
/* Allocate a kthread for asynchronous hw submit handler. */
|
||||
video->kworker = kthread_run_worker(0, "UVCG");
|
||||
if (IS_ERR(video->kworker)) {
|
||||
uvcg_err(&video->uvc->func, "failed to create UVCG kworker\n");
|
||||
uvcg_err(&uvc->func, "failed to create UVCG kworker\n");
|
||||
return PTR_ERR(video->kworker);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user