Skip to contentSkip to conversation

patch "iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock()" added to staging-linus

PATCH [email protected] 1 participant 1 message Mar 19, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock()

to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From 3c3e4b3a708a9d6451052e348981f37d2b3e92b0 Mon Sep 17 00:00:00 2001

From: Dan Carpenter <[email protected]>
Date: Thu, 8 Mar 2018 12:31:53 +0300
Subject: iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock()

The meson_sar_adc_lock() function is not supposed to hold the "indio_dev->mlock" on the error path.

Fixes 3adbf3427330 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs")
---
 drivers/iio/adc/meson_saradc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/adc/meson_saradc.c +3 -1
index 29fa7736d80c..ede955d9b2a4 100644
@@ -462,8 +462,10 @@ static int meson_sar_adc_lock(struct iio_dev *indio_dev)
 			regmap_read(priv->regmap, MESON_SAR_ADC_DELAY, &val);
 		} while (val & MESON_SAR_ADC_DELAY_BL30_BUSY && timeout--);
 
-		if (timeout < 0)
+		if (timeout < 0) {
+			mutex_unlock(&indio_dev->mlock);
 			return -ETIMEDOUT;
+		}
 	}
 
 	return 0;
Signature · 1 line
2.16.2