Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1631147 > unrolled thread

Re: [PATCH] iio: inkern: fix a static checker error

Started byJonathan Cameron <jic23@kernel.org>
First post2017-04-26 07:10 +0200
Last post2017-04-26 07:10 +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.


Contents

  Re: [PATCH] iio: inkern: fix a static checker error Jonathan Cameron <jic23@kernel.org> - 2017-04-26 07:10 +0200

#1631147 — Re: [PATCH] iio: inkern: fix a static checker error

FromJonathan Cameron <jic23@kernel.org>
Date2017-04-26 07:10 +0200
SubjectRe: [PATCH] iio: inkern: fix a static checker error
Message-ID<tAnnb-6ff-5@gated-at.bofh.it>
On 24/04/17 10:32, Peter Rosin wrote:
> On 2017-04-20 23:13, Peter Rosin wrote:
>> On 2017-04-20 23:12, Lars-Peter Clausen wrote:
>>> 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.
>>
>> Yes, it should probably go to stable too...
> 
> Nope, not an endless loop, but I of course only noticed after sending
> a v2 [1] which falsely stated just that. Ignore that v2 patch and take
> this one instead, for the reasons stated in my followup [2] to that
> message.
> 
> Involving stable is probably not needed either...
Applied to the togreg branch of iio.git.  Thanks,

Jonathan
> 
> Cheers,
> peda
> 
> [1] https://lkml.org/lkml/2017/4/24/179
> [2] https://lkml.org/lkml/2017/4/24/221
> 
>>>>
>>>> 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;
>>>>  }
>>>>
>>>
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web