Skip to contentSkip to conversation

media: smiapp: unlock on error in smiapp_start_streaming()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 29, 2019 – Oct 30, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: smiapp: unlock on error in smiapp_start_streaming()

We added two new error paths to smiapp_start_streaming(), but we can't return directly without dropping the "sensor->mutex" lock.

Fixes f8c4352c1bef ("media: smiapp: Move binning configuration to streaming start")
---
 drivers/media/i2c/smiapp/smiapp-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/smiapp/smiapp-core.c +2 -2
index 77dfce7c3be9..84f9771b5fed 100644
@@ -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);
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · Dan Carpenter

We added two new error paths to smiapp_start_streaming(), but we can't return directly without dropping the "sensor->mutex" lock.

Fixes f8c4352c1bef ("media: smiapp: Move binning configuration to streaming start")

Thanks, Dan!

Signature · 1 line
Sakari Ailus