From: Hans Verkuil Date: Mon, 3 Feb 2014 14:22:45 +0000 (-0300) Subject: [media] vb2: replace BUG by WARN_ON X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e4d2581649fe87bbd506c4d55591c4de9d2962d8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] vb2: replace BUG by WARN_ON No need to oops for this, WARN_ON is good enough. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- 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.