All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: linux-media@vger.kernel.org
Cc: Mike Isely <isely@pobox.com>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Hans Verkuil <hansverk@cisco.com>
Subject: [RFC PATCH 4/6] videobuf2-core: require q->lock
Date: Mon, 14 May 2018 13:56:00 +0200	[thread overview]
Message-ID: <20180514115602.9791-5-hverkuil@xs4all.nl> (raw)
In-Reply-To: <20180514115602.9791-1-hverkuil@xs4all.nl>

From: Hans Verkuil <hansverk@cisco.com>

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

Signed-off-by: Hans Verkuil <hansverk@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 d3f7bb33a54d..3b89ec5e0b2f 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -2002,6 +2002,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.0

  parent reply	other threads:[~2018-05-14 11:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 11:55 [RFC PATCH 0/6] v4l2 core: push ioctl lock down to ioctl handler Hans Verkuil
2018-05-14 11:55 ` [RFC PATCH 1/6] pvrusb2: replace pvr2_v4l2_ioctl by video_ioctl2 Hans Verkuil
2018-05-14 12:11   ` Hans Verkuil
2018-05-14 11:55 ` [RFC PATCH 2/6] v4l2-core: push taking ioctl mutex down to ioctl handler Hans Verkuil
2018-05-14 21:02   ` Ezequiel Garcia
2018-05-14 11:55 ` [RFC PATCH 3/6] v4l2-ioctl.c: use correct vb2_queue lock for m2m devices Hans Verkuil
2018-05-14 11:56 ` Hans Verkuil [this message]
2018-05-14 11:56 ` [RFC PATCH 5/6] videobuf2: assume q->lock is always set Hans Verkuil
2018-05-14 11:56 ` [RFC PATCH 6/6] v4l2-ioctl.c: assume queue->lock " Hans Verkuil
2018-05-14 12:09 ` [RFC PATCH 0/6] v4l2 core: push ioctl lock down to ioctl handler Hans Verkuil

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=20180514115602.9791-5-hverkuil@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=ezequiel@collabora.com \
    --cc=hansverk@cisco.com \
    --cc=isely@pobox.com \
    --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.