linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] iio:dac:ad5449: unlock on error path
Date: Wed, 24 Oct 2012 10:22:52 +0200	[thread overview]
Message-ID: <5087A55C.6010202@metafoo.de> (raw)
In-Reply-To: <20121024071307.GC2536@elgon.mountain>

On 10/24/2012 09:13 AM, Dan Carpenter wrote:
> There is an unlock missing on this error path.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks,

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

> ---
> Only needed in linux-next.
> 
> diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c
> index 5b43030..0ee6f8e 100644
> --- a/drivers/iio/dac/ad5449.c
> +++ b/drivers/iio/dac/ad5449.c
> @@ -124,12 +124,13 @@ static int ad5449_read(struct iio_dev *indio_dev, unsigned int addr,
>  
>  	ret = spi_sync(st->spi, &msg);
>  	if (ret < 0)
> -		return ret;
> +		goto out_unlock;
>  
>  	*val = be16_to_cpu(st->data[1]);
> -	mutex_unlock(&indio_dev->mlock);
>  
> -	return 0;
> +out_unlock:
> +	mutex_unlock(&indio_dev->mlock);
> +	return ret;
>  }
>  
>  static int ad5449_read_raw(struct iio_dev *indio_dev,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2012-10-24  8:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24  7:13 [patch] iio:dac:ad5449: unlock on error path Dan Carpenter
2012-10-24  8:22 ` Lars-Peter Clausen [this message]
2012-11-02 11:06   ` Jonathan Cameron
2012-11-02 16:52     ` walter harms
2012-11-05  6:38       ` 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=5087A55C.6010202@metafoo.de \
    --to=lars@metafoo.de \
    --cc=dan.carpenter@oracle.com \
    --cc=jic23@cam.ac.uk \
    --cc=kernel-janitors@vger.kernel.org \
    --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).