OSDN Git Service

[media] vb2: replace BUG by WARN_ON
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 3 Feb 2014 14:22:45 +0000 (11:22 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 11 Mar 2014 09:56:43 +0000 (06:56 -0300)
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>
drivers/media/v4l2-core/videobuf2-core.c

index 17f1d07..f8fe1d9 100644 (file)
@@ -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.