1 From 4beea0c16ceaefc78e2fb6b5a2a0548bd6d04ee6 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Thu, 10 May 2018 12:42:14 -0700
4 Subject: [PATCH 374/454] staging: bcm2835-camera: Replace BUG_ON with return
7 commit 84db34cd720964adf0c9019d6d1b4de1cb26d1de upstream.
9 The error conditions don't warrant taking the kernel down, so remove
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
13 Signed-off-by: Eric Anholt <eric@anholt.net>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16 .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 7 ++++---
17 1 file changed, 4 insertions(+), 3 deletions(-)
19 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
20 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
21 @@ -304,8 +304,8 @@ static int buffer_prepare(struct vb2_buf
22 v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "%s: dev:%p, vb %p\n",
25 - BUG_ON(!dev->capture.port);
26 - BUG_ON(!dev->capture.fmt);
27 + if (!dev->capture.port || !dev->capture.fmt)
30 size = dev->capture.stride * dev->capture.height;
31 if (vb2_plane_size(vb, 0) < size) {
32 @@ -1050,7 +1050,8 @@ static int mmal_setup_components(struct
33 struct mmal_fmt *mfmt = get_format(f);
40 if (dev->capture.encode_component) {
41 v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,