forked from Minki/linux
bus: sunxi-rsb: unlock on error in sunxi_rsb_read()
Don't forget to unlock before returning an error code.
Fixes: d787dcdb9c
('bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
This commit is contained in:
parent
c65d2359a8
commit
43675ffafd
@ -342,13 +342,13 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,
|
|||||||
|
|
||||||
ret = _sunxi_rsb_run_xfer(rsb);
|
ret = _sunxi_rsb_run_xfer(rsb);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto unlock;
|
||||||
|
|
||||||
*buf = readl(rsb->regs + RSB_DATA);
|
*buf = readl(rsb->regs + RSB_DATA);
|
||||||
|
|
||||||
|
unlock:
|
||||||
mutex_unlock(&rsb->lock);
|
mutex_unlock(&rsb->lock);
|
||||||
|
|
||||||
out:
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user