diff mbox series

iio: accel: adxl367: unlock on error in adxl367_buffer_predisable()

Message ID 20220224150228.GB6856@kili (mailing list archive)
State Accepted
Headers show
Series iio: accel: adxl367: unlock on error in adxl367_buffer_predisable() | expand

Commit Message

Dan Carpenter Feb. 24, 2022, 3:02 p.m. UTC
This error path needs to call the mutex_unlock(&st->lock) before
returning.

Fixes: cbab791c5e2a ("iio: accel: add ADXL367 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/iio/accel/adxl367.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron Feb. 26, 2022, 5:58 p.m. UTC | #1
On Thu, 24 Feb 2022 18:02:28 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> This error path needs to call the mutex_unlock(&st->lock) before
> returning.
> 
> Fixes: cbab791c5e2a ("iio: accel: add ADXL367 driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied to the togreg branch of iio.git.

Jonathan

> ---
>  drivers/iio/accel/adxl367.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
> index b452d74b1d4d..bdc95409abed 100644
> --- a/drivers/iio/accel/adxl367.c
> +++ b/drivers/iio/accel/adxl367.c
> @@ -1359,7 +1359,7 @@ static int adxl367_buffer_predisable(struct iio_dev *indio_dev)
>  
>  	ret = adxl367_set_measure_en(st, true);
>  	if (ret)
> -		return ret;
> +		goto out;
>  
>  	ret = adxl367_set_temp_adc_mask_en(st, indio_dev->active_scan_mask,
>  					   false);
diff mbox series

Patch

diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
index b452d74b1d4d..bdc95409abed 100644
--- a/drivers/iio/accel/adxl367.c
+++ b/drivers/iio/accel/adxl367.c
@@ -1359,7 +1359,7 @@  static int adxl367_buffer_predisable(struct iio_dev *indio_dev)
 
 	ret = adxl367_set_measure_en(st, true);
 	if (ret)
-		return ret;
+		goto out;
 
 	ret = adxl367_set_temp_adc_mask_en(st, indio_dev->active_scan_mask,
 					   false);