-From 83ba21bb6043c5afc3d497e9be4e128b3e1adf93 Mon Sep 17 00:00:00 2001
+From 7270f7555eb3d8144844c110e10f20558e563de6 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Fri, 10 Mar 2017 17:27:56 +0000
-Subject: [PATCH 242/703] staging: bcm2835-camera: Return early on errors
+Subject: [PATCH 242/725] staging: bcm2835-camera: Return early on errors
Fix several instances where it is easier to return
early on error conditions than handle it as an else
+
+ if (length == 0) {
/* stream ended */
- if (buf) {
- /* this should only ever happen if the port is
-@@ -358,71 +360,72 @@ static void buffer_cb(struct vchiq_mmal_
- /* signal frame completion */
+ if (dev->capture.frame_count) {
+ /* empty buffer whilst capturing - expected to be an
+@@ -361,71 +363,72 @@ static void buffer_cb(struct vchiq_mmal_
+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
complete(&dev->capture.frame_cmplt);
}
- } else {
}
static int enable_camera(struct bm2835_mmal_dev *dev)
-@@ -802,27 +805,29 @@ static int vidioc_overlay(struct file *f
+@@ -815,27 +818,29 @@ static int vidioc_overlay(struct file *f
ret = vchiq_mmal_port_set_format(dev->instance, src);
if (ret < 0)