diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-06-26 04:43:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-26 17:57:30 -0400 |
commit | 90e6dc7c274dca8a9198e3525488ea991719a799 (patch) | |
tree | 80c0cf43ce915bbd5871374d27b31ba14e64a816 /drivers/iio/adc/at91_adc.c | |
parent | bb23378c0b1c9a410d40adea74276544a00fb94e (diff) |
iio:adc:at91: Relase mutex on error path in at91_adc_read_raw
This issue was reported by the mini_lock.cocci coccinelle semantic patch.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/adc/at91_adc.c')
-rw-r--r-- | drivers/iio/adc/at91_adc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 6a084695b77e..f61780a02374 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c | |||
@@ -349,9 +349,11 @@ static int at91_adc_read_raw(struct iio_dev *idev, | |||
349 | st->done, | 349 | st->done, |
350 | msecs_to_jiffies(1000)); | 350 | msecs_to_jiffies(1000)); |
351 | if (ret == 0) | 351 | if (ret == 0) |
352 | return -ETIMEDOUT; | 352 | ret = -ETIMEDOUT; |
353 | else if (ret < 0) | 353 | if (ret < 0) { |
354 | mutex_unlock(&st->lock); | ||
354 | return ret; | 355 | return ret; |
356 | } | ||
355 | 357 | ||
356 | *val = st->last_value; | 358 | *val = st->last_value; |
357 | 359 | ||