summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core/videobuf2-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-02-03 11:22:45 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-11 06:56:43 -0300
commite4d2581649fe87bbd506c4d55591c4de9d2962d8 (patch)
tree53a18a8f0953fbb0ab8e5445f9457e2bced64502 /drivers/media/v4l2-core/videobuf2-core.c
parentfb64dca805f091b52dbe8d6504390f63d961cbbd (diff)
[media] vb2: replace BUG by WARN_ON
No need to oops for this, WARN_ON is good enough. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core/videobuf2-core.c')
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 17f1d071739c..f8fe1d9c7b4f 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2597,9 +2597,9 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read)
/*
* Sanity check
*/
- if ((read && !(q->io_modes & VB2_READ)) ||
- (!read && !(q->io_modes & VB2_WRITE)))
- BUG();
+ if (WARN_ON((read && !(q->io_modes & VB2_READ)) ||
+ (!read && !(q->io_modes & VB2_WRITE))))
+ return -EINVAL;
/*
* Check if device supports mapping buffers to kernel virtual space.