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:
Dan Carpenter 2015-11-04 01:02:44 +03:00 committed by Maxime Ripard
parent c65d2359a8
commit 43675ffafd

View File

@ -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;
} }