From: Jonathan Cameron <jic23@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Carlo Caione <carlo@caione.org>,
Kevin Hilman <khilman@baylibre.com>,
Rob Herring <robh@kernel.org>,
Paolo Cretaro <paolocretaro@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>,
Xingyu Chen <xingyu.chen@amlogic.com>,
linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock()
Date: Sat, 10 Mar 2018 15:15:14 +0000 [thread overview]
Message-ID: <20180310151514.21f9b1ff@archlinux> (raw)
In-Reply-To: <20180308093153.GB16525@mwanda>
On Thu, 8 Mar 2018 12:31:53 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>
>
Applied to the fixes-togreg branch of iio.git and marked for stable.
Thanks
Jonathan
> diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
> index 29fa7736d80c..ede955d9b2a4 100644
> --- 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_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;
next prev parent reply other threads:[~2018-03-10 15:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-08 9:31 [PATCH] iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock() Dan Carpenter
2018-03-10 15:15 ` Jonathan Cameron [this message]
2018-03-12 20:43 ` Martin Blumenstingl
2018-03-13 8:16 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180310151514.21f9b1ff@archlinux \
--to=jic23@kernel.org \
--cc=carlo@caione.org \
--cc=dan.carpenter@oracle.com \
--cc=garsilva@embeddedor.com \
--cc=hkallweit1@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=khilman@baylibre.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=paolocretaro@gmail.com \
--cc=pmeerw@pmeerw.net \
--cc=robh@kernel.org \
--cc=xingyu.chen@amlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox