lkml.org 
[lkml]   [2015]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/2] w1: unlock correct lock on error in w1_seq_show()
Thanks for including me, I'm going to have to nack this though, it is
an error, but bus_mutex is correct, mutex is incorrect, so the other
two lock/unlock in that routine are the ones that need to be changed.

w1.h
* @mutex: protect most of w1_master
* @bus_mutex: pretect concurrent bus access

On Mon, Jun 01, 2015 at 12:56:32PM +0300, Dan Carpenter wrote:
> Smatch complains that we don't unlock "master->mutex" on this error
> path. It looks like it is a typo and we unlock ->bus_mutext where
> ->mutex was intended.
>
> Fixes: d9411e57dc7f ('w1: Add support for DS28EA00 sequence to w1-therm')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
> index 3351be6..79ecaf8 100644
> --- a/drivers/w1/slaves/w1_therm.c
> +++ b/drivers/w1/slaves/w1_therm.c
> @@ -412,7 +412,7 @@ static ssize_t w1_seq_show(struct device *device,
> c -= snprintf(buf + PAGE_SIZE - c, c, "%d\n", seq);
> return PAGE_SIZE - c;
> error:
> - mutex_unlock(&sl->master->bus_mutex);
> + mutex_unlock(&sl->master->mutex);
> return -EIO;
> }
>

--
David Fries <david@fries.net>


\
 
 \ /
  Last update: 2015-06-02 15:01    [W:0.079 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site