linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, Jonathan Cameron <jic23@cam.ac.uk>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 2/4] inkern: iio_device_put after incorrect return/goto
Date: Tue, 04 Jun 2013 18:28:55 +0100	[thread overview]
Message-ID: <51AE23D7.8030507@kernel.org> (raw)
In-Reply-To: <d0f7d0eef677250c457c08c8f8ca7e125811f754.1370356776.git.joe@perches.com>

On 06/04/2013 03:44 PM, Joe Perches wrote:
> The code uses
> 
>     return foo;
>     goto err_type;
> 
> when instead the form should have been
> 
>     ret = foo;
>     goto err_type;
> 
> Here this causes a useful iio_device_put to be skipped.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
Applied to fixes-togreg branch of iio.git

Thanks,
> ---
>  drivers/iio/inkern.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index 795d100..dca4eed 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -124,7 +124,7 @@ static int __of_iio_channel_get(struct iio_channel *channel,
>  	channel->indio_dev = indio_dev;
>  	index = iiospec.args_count ? iiospec.args[0] : 0;
>  	if (index >= indio_dev->num_channels) {
> -		return -EINVAL;
> +		err = -EINVAL;
>  		goto err_put;
>  	}
>  	channel->channel = &indio_dev->channels[index];
> 

      reply	other threads:[~2013-06-04 17:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <60123fd3175b7cceadf6c335b12e58b797e18f65.1370356776.git.joe@perches.com>
2013-06-04 14:44 ` [PATCH 2/4] inkern: iio_device_put after incorrect return/goto Joe Perches
2013-06-04 17:28   ` 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=51AE23D7.8030507@kernel.org \
    --to=jic23@kernel.org \
    --cc=jic23@cam.ac.uk \
    --cc=joe@perches.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@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).