lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180510194220.30675-11-eric@anholt.net>
Date:   Thu, 10 May 2018 12:42:14 -0700
From:   Eric Anholt <eric@...olt.net>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        linux-rpi-kernel@...ts.infradead.org,
        Stefan Wahren <stefan.wahren@...e.com>
Cc:     Dave Stevenson <dave.stevenson@...pberrypi.org>,
        Eric Anholt <eric@...olt.net>
Subject: [PATCH 10/15] staging: bcm2835-camera: Replace BUG_ON with return error

From: Dave Stevenson <dave.stevenson@...pberrypi.org>

The error conditions don't warrant taking the kernel down, so remove
BUG_ON.

Signed-off-by: Dave Stevenson <dave.stevenson@...pberrypi.org>
Signed-off-by: Eric Anholt <eric@...olt.net>
---
 .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c  | 7 ++++---
 1 file 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,
-- 
2.17.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ