stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock()" has been added to the 4.15-stable tree
@ 2018-03-24 17:25 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-03-24 17:25 UTC (permalink / raw)
  To: dan.carpenter, Jonathan.Cameron, Stable, gregkh; +Cc: stable, stable-commits


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 the 4.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iio-adc-meson-saradc-unlock-on-error-in-meson_sar_adc_lock.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 3c3e4b3a708a9d6451052e348981f37d2b3e92b0 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 8 Mar 2018 12:31:53 +0300
Subject: iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock()

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 3c3e4b3a708a9d6451052e348981f37d2b3e92b0 upstream.

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/adc/meson_saradc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -462,8 +462,10 @@ static int meson_sar_adc_lock(struct iio
 			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;


Patches currently in stable-queue which might be from dan.carpenter@oracle.com are

queue-4.15/iio-adc-meson-saradc-unlock-on-error-in-meson_sar_adc_lock.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-24 17:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-24 17:25 Patch "iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock()" has been added to the 4.15-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).