1
0
Fork 0

inkern: iio_device_put after incorrect return/goto

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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
hifive-unleashed-5.1
Joe Perches 2013-06-04 15:44:00 +01:00 committed by Jonathan Cameron
parent 702df9f181
commit e916b80d2b
1 changed files with 1 additions and 1 deletions

View File

@ -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];