lkml.org 
[lkml]   [2013]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@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];
>


\
 
 \ /
  Last update: 2013-06-04 20:01    [W:0.141 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site