aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 59ed5223393..e6a26b433e8 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1738,14 +1738,17 @@ EXPORT_SYMBOL_GPL(vb2_poll);
1738 */ 1738 */
1739int vb2_queue_init(struct vb2_queue *q) 1739int vb2_queue_init(struct vb2_queue *q)
1740{ 1740{
1741 BUG_ON(!q); 1741 /*
1742 BUG_ON(!q->ops); 1742 * Sanity check
1743 BUG_ON(!q->mem_ops); 1743 */
1744 BUG_ON(!q->type); 1744 if (WARN_ON(!q) ||
1745 BUG_ON(!q->io_modes); 1745 WARN_ON(!q->ops) ||
1746 1746 WARN_ON(!q->mem_ops) ||
1747 BUG_ON(!q->ops->queue_setup); 1747 WARN_ON(!q->type) ||
1748 BUG_ON(!q->ops->buf_queue); 1748 WARN_ON(!q->io_modes) ||
1749 WARN_ON(!q->ops->queue_setup) ||
1750 WARN_ON(!q->ops->buf_queue))
1751 return -EINVAL;
1749 1752
1750 INIT_LIST_HEAD(&q->queued_list); 1753 INIT_LIST_HEAD(&q->queued_list);
1751 INIT_LIST_HEAD(&q->done_list); 1754 INIT_LIST_HEAD(&q->done_list);