Messages in this thread | | | Date | Tue, 04 Jun 2013 18:28:55 +0100 | From | Jonathan Cameron <> | 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@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]; >
| |