From: Joe Perches Date: Tue, 4 Jun 2013 14:44:00 +0000 (+0100) Subject: inkern: iio_device_put after incorrect return/goto X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e916b80d2b1988e985abc0a1c85eca5b96c61f48;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 795d100b4c36..dca4eed7b034 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];