media: usb: em28xx: check if vbi is supported before calling, vb2_queue_init
Subsystems (2)
PATCH 1/1 media: usb: em28xx: check if vbi is supported before calling, vb2_queue_init
If the device does not support vbi, then the vbi queue is still initialized with vb2_queue_init(), which fails with a WARNing because the q->lock pointer is never set.
Only call vb2_queue_init for the vbi queue if vbi is actually supported.
Signed-off-by Hans Verkuil <[email protected]>
Tested-by Hans Verkuil <[email protected]>
Reported-by Lars Ljung <[email protected]>
--- drivers/media/usb/em28xx/em28xx-video.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/usb/em28xx/em28xx-video.c +3 -0
@@ -1410,6 +1410,9 @@ static int em28xx_vb2_setup(struct em28xx *dev)if (rc <0 )return rc; +if (!em28xx_vbi_supported (dev)) +return 0 ; +/* Setup Videobuf2 for VBI capture */ q = &v4l2->vb_vbiq; q->type =V4L2_BUF_TYPE_VBI_CAPTURE ;
Signature · 1 line
2.53.0
Quoted 11 lines · Hans Verkuil
If the device does not support vbi, then the vbi queue is still initialized with
vb2_queue_init(), which fails with a WARNing because theq->lockpointer is never set.Only call
vb2_queue_initfor the vbi queue if vbi is actually supported.Signed-off-by Hans Verkuil <[email protected]>Tested-by Hans Verkuil <[email protected]>Reported-by Lars Ljung <[email protected]>
Reviewed-by Sakari Ailus <[email protected]>
Signature · 1 line
Sakari Ailus