Skip to contentSkip to conversation

media: usb: em28xx: check if vbi is supported before calling, vb2_queue_init

PATCH In review Hans Verkuil 2 participants 2 messages Jul 31 – Sep 8

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/media/usb/em28xx/em28xx-video.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/usb/em28xx/em28xx-video.c +3 -0
index c418add65bb5..3e72d9613dd2 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
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 the q->lock pointer is never set.

Only call vb2_queue_init for the vbi queue if vbi is actually supported.

Signature · 1 line
Sakari Ailus