[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51AE23D7.8030507@kernel.org>
Date: Tue, 04 Jun 2013 18:28:55 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Joe Perches <joe@...ches.com>
CC: linux-kernel@...r.kernel.org, Jonathan Cameron <jic23@....ac.uk>,
linux-iio@...r.kernel.org
Subject: Re: [PATCH 2/4] inkern: iio_device_put after incorrect return/goto
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@...ches.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];
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists