]> git.baikalelectronics.ru Git - kernel.git/commit
w1: do not unlock unheld list_mutex in __w1_remove_master_device()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Tue, 6 May 2014 21:26:04 +0000 (01:26 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 May 2014 21:08:46 +0000 (14:08 -0700)
commit4f7e4880553ff8cfaa480bdb377bb9cf9774a469
tree1b6a9e19b07eda7cf09408403cb84822c58436da
parent54737460f56902cf7f4329043ebc784d48eb3581
w1: do not unlock unheld list_mutex in __w1_remove_master_device()

w1_process_callbacks() expects to be called with dev->list_mutex held,
but it is the fact only in w1_process(). __w1_remove_master_device()
calls w1_process_callbacks() after it releases list_mutex.

The patch fixes __w1_remove_master_device() to acquire list_mutex
for w1_process_callbacks().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: David Fries <david@fries.net>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: stable <stable@vger.kernel.org> # 3.15
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/w1.c
drivers/w1/w1_int.c