]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iio: inkern: fix a static checker error
authorPeter Rosin <peda@axentia.se>
Thu, 20 Apr 2017 21:01:57 +0000 (23:01 +0200)
committerJonathan Cameron <jic23@kernel.org>
Wed, 26 Apr 2017 05:04:06 +0000 (06:04 +0100)
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 <peda@axentia.se>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/inkern.c

index 7a13535dc3e99b016c546f48a91009d458ea5b72..a3941bade6a7503c3aa60c00a97f814cf26ba632 100644 (file)
@@ -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;
 }