staging: iio: ad7152: Fix deadlock in ad7152_write_raw_samp_freq()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 26 May 2017 22:53:04 +0000 (01:53 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 28 May 2017 14:45:46 +0000 (15:45 +0100)
commit95264c8c6a9040e84edda883dbbe9d193c41f46c
tree2b8d34342f67f0408c0775a49da54c9460e6be90
parent3d51b956267343a65498704ada854c33c0f5e946
staging: iio: ad7152: Fix deadlock in ad7152_write_raw_samp_freq()

ad7152_write_raw_samp_freq() is called by ad7152_write_raw() with
chip->state_lock held. So, there is unavoidable deadlock when
ad7152_write_raw_samp_freq() locks the mutex itself.

The patch removes unneeded locking.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 6572389bcc11 ("staging: iio: cdc: ad7152: Implement
IIO_CHAN_INFO_SAMP_FREQ attribute")
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/cdc/ad7152.c