Skip to content

Commit

Permalink
iio: inkern: fix a static checker error
Browse files Browse the repository at this point in the history
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: 00c5f80 ("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>
  • Loading branch information
Peter Rosin authored and Jonathan Cameron committed Apr 26, 2017
1 parent 9a043b0 commit c773f70
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/iio/inkern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c773f70

Please sign in to comment.