projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb23378
)
iio:adc:at91: Relase mutex on error path in at91_adc_read_raw
author
Lars-Peter Clausen
<lars@metafoo.de>
Tue, 26 Jun 2012 08:43:05 +0000
(10:43 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 26 Jun 2012 21:57:30 +0000
(14:57 -0700)
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>
drivers/iio/adc/at91_adc.c
patch
|
blob
|
history
diff --git
a/drivers/iio/adc/at91_adc.c
b/drivers/iio/adc/at91_adc.c
index
6a08469
..
f61780a
100644
(file)
--- 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,
st->done,
msecs_to_jiffies(1000));
if (ret == 0)
- return -ETIMEDOUT;
- else if (ret < 0)
+ ret = -ETIMEDOUT;
+ if (ret < 0) {
+ mutex_unlock(&st->lock);
return ret;
+ }
*val = st->last_value;