From: Peter Rosin Date: Thu, 20 Apr 2017 21:01:57 +0000 (+0200) Subject: iio: inkern: fix a static checker error X-Git-Tag: v4.13-rc1~184^2~262^2~58 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c773f70015f6f07f4abe93b486da7f53fde6e878;p=karo-tx-linux.git iio: inkern: fix a static checker error Avoid this smatch error: drivers/iio/inkern.c:751 iio_read_avail_channel_raw() error: double unlock 'mutex:&chan->indio_dev->info_exist_lock' Fixes: 00c5f80c2fad ("iio: inkern: add helpers to query available values from channels") Signed-off-by: Peter Rosin Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 7a13535dc3e9..a3941bade6a7 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -750,11 +750,9 @@ int iio_read_avail_channel_raw(struct iio_channel *chan, err_unlock: mutex_unlock(&chan->indio_dev->info_exist_lock); - if (ret >= 0 && type != IIO_VAL_INT) { + if (ret >= 0 && type != IIO_VAL_INT) /* raw values are assumed to be IIO_VAL_INT */ ret = -EINVAL; - goto err_unlock; - } return ret; }