diff options
author | Dave Stevenson <dave.stevenson@raspberrypi.org> | 2018-05-10 12:42:14 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-11 12:02:05 +0200 |
commit | 84db34cd720964adf0c9019d6d1b4de1cb26d1de (patch) | |
tree | 3ee5f91e7685ef3d0e0326354465bb71cd251008 /drivers/staging | |
parent | 84adcb14133ed2412d54355539a8ab4d6a3fcabc (diff) |
staging: bcm2835-camera: Replace BUG_ON with return error
The error conditions don't warrant taking the kernel down, so remove
BUG_ON.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index c5ca56414139..bd6bf3d991ef 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -302,8 +302,8 @@ static int buffer_prepare(struct vb2_buffer *vb) v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "%s: dev:%p, vb %p\n", __func__, dev, vb); - BUG_ON(!dev->capture.port); - BUG_ON(!dev->capture.fmt); + if (!dev->capture.port || !dev->capture.fmt) + return -ENODEV; size = dev->capture.stride * dev->capture.height; if (vb2_plane_size(vb, 0) < size) { @@ -1017,7 +1017,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, struct mmal_fmt *mfmt = get_format(f); u32 remove_padding; - BUG_ON(!mfmt); + if (!mfmt) + return -EINVAL; if (dev->capture.encode_component) { v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, |