Skip to content

Commit

Permalink
iio:adc:at91: Relase mutex on error path in at91_adc_read_raw
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars-Peter Clausen authored and Greg Kroah-Hartman committed Jun 26, 2012
1 parent bb23378 commit 90e6dc7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/iio/adc/at91_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 90e6dc7

Please sign in to comment.