]> git.baikalelectronics.ru Git - kernel.git/commit
iio: dac: ad5592r: fix unbalanced mutex unlocks in ad5592r_read_raw()
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Mon, 6 Jul 2020 11:02:57 +0000 (14:02 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 22 Jul 2020 13:51:54 +0000 (14:51 +0100)
commit3a52273316e53ce53423860932b4244584d4ba03
tree477814fe774896e48c14da4e1ce416bfe3ef7c56
parent12d81ccc2cf44a9867c753e7eb1b4b19d1480329
iio: dac: ad5592r: fix unbalanced mutex unlocks in ad5592r_read_raw()

There are 2 exit paths where the lock isn't held, but try to unlock the
mutex when exiting. In these places we should just return from the
function.

A neater approach would be to cleanup the ad5592r_read_raw(), but that
would make this patch more difficult to backport to stable versions.

Fixes c4382950068ad: ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
Reported-by: Charles Stanhope <charles.stanhope@gmail.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ad5592r-base.c