Commit 90e6dc7c authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Greg Kroah-Hartman

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bb23378c
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment