From: Hans Verkuil <hansv...@cisco.com>

Refuse to initialize a vb2 queue if there is no lock specified.

Signed-off-by: Hans Verkuil <hansv...@cisco.com>
---
 drivers/media/common/videobuf2/videobuf2-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/common/videobuf2/videobuf2-core.c 
b/drivers/media/common/videobuf2/videobuf2-core.c
index f32ec7342ef0..0d8e93f9a622 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -2005,6 +2005,7 @@ int vb2_core_queue_init(struct vb2_queue *q)
        if (WARN_ON(!q)                   ||
            WARN_ON(!q->ops)              ||
            WARN_ON(!q->mem_ops)          ||
+           WARN_ON(!q->lock)             ||
            WARN_ON(!q->type)             ||
            WARN_ON(!q->io_modes)         ||
            WARN_ON(!q->ops->queue_setup) ||
-- 
2.17.1

Reply via email to