Skip to content

Commit d9e7c17

Browse files
committed
media: rtl2832_sdr: assign vb2 lock before vb2_queue_init
Commit c780d01 ("media: vb2: vb2_core_queue_init(): sanity check lock and wait_prepare/finish") added a sanity check to ensure that if there are no wait_prepare/finish callbacks set by the driver, then the vb2_queue lock must be set, since otherwise the vb2 core cannot do correct locking. The rtl2832_sdr.c triggered this warning: it turns out that while the driver does set this lock, it sets it too late. So move it up to before the vb2_queue_init() call. Reported-by: Arthur Marsh <arthur.marsh@internode.on.net> Closes: https://lore.kernel.org/linux-media/20241211042355.8479-1-user@am64/ Fixes: 8fcd279 ("media: rtl2832_sdr: drop vb2_ops_wait_prepare/finish") Cc: stable@vger.kernel.org Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
1 parent 2014c95 commit d9e7c17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/dvb-frontends/rtl2832_sdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,7 @@ static int rtl2832_sdr_probe(struct platform_device *pdev)
13631363
dev->vb_queue.ops = &rtl2832_sdr_vb2_ops;
13641364
dev->vb_queue.mem_ops = &vb2_vmalloc_memops;
13651365
dev->vb_queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
1366+
dev->vb_queue.lock = &dev->vb_queue_lock;
13661367
ret = vb2_queue_init(&dev->vb_queue);
13671368
if (ret) {
13681369
dev_err(&pdev->dev, "Could not initialize vb2 queue\n");
@@ -1421,7 +1422,6 @@ static int rtl2832_sdr_probe(struct platform_device *pdev)
14211422
/* Init video_device structure */
14221423
dev->vdev = rtl2832_sdr_template;
14231424
dev->vdev.queue = &dev->vb_queue;
1424-
dev->vdev.queue->lock = &dev->vb_queue_lock;
14251425
video_set_drvdata(&dev->vdev, dev);
14261426

14271427
/* Register the v4l2_device structure */

0 commit comments

Comments
 (0)