diff mbox series

[2/8] smiapp: smiapp_start_streaming(): replace return by goto

Message ID 20191103112338.22569-3-hverkuil-cisco@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series Fix various smatch warnings/errors | expand

Commit Message

Hans Verkuil Nov. 3, 2019, 11:23 a.m. UTC
There were still two returns in smiapp_start_streaming() that should
have been a goto to ensure mutex_unload was called before returning.

This fixes this smatch warning:

drivers/media/i2c/smiapp/smiapp-core.c:1483 smiapp_start_streaming() warn: inconsistent returns 'mutex:&sensor->mutex'.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/smiapp/smiapp-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Sakari Ailus Nov. 4, 2019, 8:12 a.m. UTC | #1
Hi Hans,

On Sun, Nov 03, 2019 at 12:23:32PM +0100, Hans Verkuil wrote:
> There were still two returns in smiapp_start_streaming() that should
> have been a goto to ensure mutex_unload was called before returning.
> 
> This fixes this smatch warning:
> 
> drivers/media/i2c/smiapp/smiapp-core.c:1483 smiapp_start_streaming() warn: inconsistent returns 'mutex:&sensor->mutex'.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>

Thanks for the patch.

Dan Carpenter submitted one with equivalent content, and it's in my pull
request to Mauro:

<URL:https://patchwork.linuxtv.org/patch/59698/>
Hans Verkuil Nov. 4, 2019, 8:17 a.m. UTC | #2
On 11/4/19 9:12 AM, Sakari Ailus wrote:
> Hi Hans,
> 
> On Sun, Nov 03, 2019 at 12:23:32PM +0100, Hans Verkuil wrote:
>> There were still two returns in smiapp_start_streaming() that should
>> have been a goto to ensure mutex_unload was called before returning.
>>
>> This fixes this smatch warning:
>>
>> drivers/media/i2c/smiapp/smiapp-core.c:1483 smiapp_start_streaming() warn: inconsistent returns 'mutex:&sensor->mutex'.
>>
>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> Thanks for the patch.
> 
> Dan Carpenter submitted one with equivalent content, and it's in my pull
> request to Mauro:
> 
> <URL:https://patchwork.linuxtv.org/patch/59698/>
> 

Thanks for the info, I've dropped this patch from my series.

Regards,

	Hans
diff mbox series

Patch

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 77dfce7c3be9..84f9771b5fed 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -1362,13 +1362,13 @@  static int smiapp_start_streaming(struct smiapp_sensor *sensor)
 		rval = smiapp_write(
 			sensor, SMIAPP_REG_U8_BINNING_TYPE, binning_type);
 		if (rval < 0)
-			return rval;
+			goto out;
 
 		binning_mode = 1;
 	}
 	rval = smiapp_write(sensor, SMIAPP_REG_U8_BINNING_MODE, binning_mode);
 	if (rval < 0)
-		return rval;
+		goto out;
 
 	/* Set up PLL */
 	rval = smiapp_pll_configure(sensor);