Skip to contentSkip to conversation

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

PATCH In review Yang Yingliang 3 participants 3 messages Feb 24, 2022 – Feb 26, 2022

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

PATCH 1/1 iio:accel:adxl367: fix missing unlock on error in adxl367_buffer_predisable()

Add the missing unlock before return from function adxl367_buffer_predisable() in the error handling case.

Fixes cbab791c5e2a ("iio: accel: add ADXL367 driver")
---
 drivers/iio/accel/adxl367.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/adxl367.c +1 -1
index b452d74b1d4d..bdc95409abed 100644
@@ -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);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 38 lines

-----Original Message-----
From: Yang Yingliang <[email protected]>
Sent: Thursday, February 24, 2022 4:03 AM
To: [email protected]; [email protected]
Cc: [email protected]; Tanislav, Cosmin <[email protected]>
Subject: [PATCH -next] iio:accel:adxl367: fix missing unlock on error in adxl367_buffer_predisable()

[External]

Add the missing unlock before return from function adxl367_buffer_predisable()
in the error handling case.

Fixes cbab791c5e2a ("iio: accel: add ADXL367 driver")
---
 drivers/iio/accel/adxl367.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/adxl367.c +1 -1
index b452d74b1d4d..bdc95409abed 100644
@@ -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-
Quoted 1 line

active_scan_mask,

false);
--
2.25.1

maintainer
#2 lore raw
Quoted 1 line · Cosmin

Sorry. I normally try to pick up the earliest fix when I get multiple fixes for the same thing but I failed to notice yours before applying the one Dan sent out!

As a result I've already picked that one up

Thanks for the patch though and I'll check more carefully next time!

Jonathan

Quoted 40 lines
Quoted 39 lines

-----Original Message-----
From: Yang Yingliang <[email protected]>
Sent: Thursday, February 24, 2022 4:03 AM
To: [email protected]; [email protected]
Cc: [email protected]; Tanislav, Cosmin <[email protected]>
Subject: [PATCH -next] iio:accel:adxl367: fix missing unlock on error in adxl367_buffer_predisable()

[External]

Add the missing unlock before return from function adxl367_buffer_predisable()
in the error handling case.

Fixes cbab791c5e2a ("iio: accel: add ADXL367 driver")
---
 drivers/iio/accel/adxl367.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/adxl367.c +1 -1
index b452d74b1d4d..bdc95409abed 100644
@@ -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-  
Quoted 1 line

active_scan_mask,

false);
--
2.25.1