linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@cam.ac.uk>, linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio:adc:at91: Relase mutex on error path in at91_adc_read_raw
Date: Mon, 25 Jun 2012 17:00:20 +0200	[thread overview]
Message-ID: <4FE87D04.4080008@free-electrons.com> (raw)
In-Reply-To: <1340631780-14685-1-git-send-email-lars@metafoo.de>

Hi Lars,

You can add my
Acked-By: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks,
Maxime

Le 25/06/2012 15:43, Lars-Peter Clausen a =E9crit :
> This issue was reported by the mini_lock.cocci coccinelle semantic patc=
h.
>=20
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
>  drivers/iio/adc/at91_adc.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>=20
> diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> index 6a08469..f61780a 100644
> --- a/drivers/iio/adc/at91_adc.c
> +++ b/drivers/iio/adc/at91_adc.c
> @@ -349,9 +349,11 @@ static int at91_adc_read_raw(struct iio_dev *idev,
>  						       st->done,
>  						       msecs_to_jiffies(1000));
>  		if (ret =3D=3D 0)
> -			return -ETIMEDOUT;
> -		else if (ret < 0)
> +			ret =3D -ETIMEDOUT;
> +		if (ret < 0) {
> +			mutex_unlock(&st->lock);
>  			return ret;
> +		}
> =20
>  		*val =3D st->last_value;
> =20


--=20
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2012-06-25 15:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 13:43 [PATCH] iio:adc:at91: Relase mutex on error path in at91_adc_read_raw Lars-Peter Clausen
2012-06-25 15:00 ` Maxime Ripard [this message]
2012-06-25 20:08   ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2012-06-26  8:43 Lars-Peter Clausen

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=4FE87D04.4080008@free-electrons.com \
    --to=maxime.ripard@free-electrons.com \
    --cc=jic23@cam.ac.uk \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).