From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Lars Ljung <lars@matholka.se>
Subject: [PATCH] media: usb: em28xx: check if vbi is supported before calling, vb2_queue_init
Date: Fri, 31 Jul 2026 12:36:52 +0200 [thread overview]
Message-ID: <3e01154b-ab4d-4cb3-90d7-a5dce4e5b2c4@kernel.org> (raw)
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 <hverkuil+cisco@kernel.org>
Tested-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Reported-by: Lars Ljung <lars@matholka.se>
Closes: https://lore.kernel.org/linux-media/8ede91cc-b505-458a-94ef-fb02270f9701@matholka.se/T/#u
---
drivers/media/usb/em28xx/em28xx-video.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index c418add65bb5..3e72d9613dd2 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -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;
--
2.53.0
next reply other threads:[~2026-07-31 10:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 10:36 Hans Verkuil [this message]
2026-09-08 12:12 ` [PATCH] media: usb: em28xx: check if vbi is supported before calling, vb2_queue_init Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e01154b-ab4d-4cb3-90d7-a5dce4e5b2c4@kernel.org \
--to=hverkuil+cisco@kernel.org \
--cc=lars@matholka.se \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.