Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1627835 > unrolled thread
| Started by | Lars-Peter Clausen <lars@metafoo.de> |
|---|---|
| First post | 2017-04-20 23:20 +0200 |
| Last post | 2017-04-20 23:20 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] iio: inkern: fix a static checker error Lars-Peter Clausen <lars@metafoo.de> - 2017-04-20 23:20 +0200
| From | Lars-Peter Clausen <lars@metafoo.de> |
|---|---|
| Date | 2017-04-20 23:20 +0200 |
| Subject | Re: [PATCH] iio: inkern: fix a static checker error |
| Message-ID | <tyrEC-5ym-7@gated-at.bofh.it> |
On 04/20/2017 11:01 PM, Peter Rosin wrote:
> Avoid this smatch error:
> drivers/iio/inkern.c:751 iio_read_avail_channel_raw() error: double unlock 'mutex:&chan->indio_dev->info_exist_lock'
Looks good, but it's not just the smatch error, this is a real issue. This
even seems to be a endless loop, always jumping back to err_unlock.
>
> Fixes: 00c5f80c2fad ("iio: inkern: add helpers to query available values from channels")
> Signed-off-by: Peter Rosin <peda@axentia.se>
> ---
> drivers/iio/inkern.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> 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;
> }
>
Back to top | Article view | linux.kernel
csiph-web