Skip to contentSkip to conversation

Staging: iio/adc/ad7150: release lock on error

PATCH In review Dan Carpenter 2 participants 2 messages Oct 6, 2011

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

PATCH 1/1 Staging: iio/adc/ad7150: release lock on error

The error_ret label should have been before the mutex_unlock(). It's a typo.

drivers/staging/iio/adc/ad7150.c +1 -1
index 8943420..d1767d8 100644
@@ -332,8 +332,8 @@ static int ad7150_write_event_value(struct iio_dev *indio_dev,
 	/* write back if active */
 	ret = ad7150_write_event_params(indio_dev, event_code);
 
-	mutex_unlock(&chip->state_lock);
 error_ret:
+	mutex_unlock(&chip->state_lock);
 	return ret;
 }
 
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Dan Carpenter

The error_ret label should have been before the mutex_unlock(). It's a typo.

Good catch thanks!

Quoted 2 lines
Quoted 16 lines
drivers/staging/iio/adc/ad7150.c +1 -1
index 8943420..d1767d8 100644
@@ -332,8 +332,8 @@ static int ad7150_write_event_value(struct iio_dev *indio_dev,
 	/* write back if active */
 	ret = ad7150_write_event_params(indio_dev, event_code);
 
-	mutex_unlock(&chip->state_lock);
 error_ret:
+	mutex_unlock(&chip->state_lock);
 	return ret;
 }