From: Jonathan Cameron <jic23@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] iio: double unlock on error path
Date: Thu, 12 Jul 2012 20:24:02 +0100 [thread overview]
Message-ID: <4FFF2452.5050003@kernel.org> (raw)
In-Reply-To: <20120711063443.GE11812@elgon.mountain>
On 07/11/2012 07:34 AM, Dan Carpenter wrote:
> We should be holding the mutex when we goto error_free_chans.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
merged to fixes-togreg branch of
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
and pull request sent. Thanks.
>
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index e2aded0..b5afc2f 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -198,11 +198,12 @@ struct iio_channel *iio_channel_get_all(const char *name)
> iio_device_get(chans[mapind].indio_dev);
> mapind++;
> }
> - mutex_unlock(&iio_map_list_lock);
> if (mapind == 0) {
> ret = -ENODEV;
> goto error_free_chans;
> }
> + mutex_unlock(&iio_map_list_lock);
> +
> return chans;
>
> error_free_chans:
>
prev parent reply other threads:[~2012-07-12 19:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-11 6:34 [patch] iio: double unlock on error path Dan Carpenter
2012-07-12 19:24 ` Jonathan Cameron [this message]
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=4FFF2452.5050003@kernel.org \
--to=jic23@kernel.org \
--cc=dan.carpenter@oracle.com \
--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).