diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-11-03 17:02:44 -0500 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2015-11-17 03:40:49 -0500 |
commit | 43675ffafd3c3373f82691f539df3dc7403877fe (patch) | |
tree | 6a7de25fe2e538d221ab620b03ca95c213c4689c /drivers | |
parent | c65d2359a85da9a09768c75ea6b9ed6254a7df71 (diff) |
bus: sunxi-rsb: unlock on error in sunxi_rsb_read()
Don't forget to unlock before returning an error code.
Fixes: d787dcdb9c8f ('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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/bus/sunxi-rsb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c index 846bc29c157d..0cfcb39c53f4 100644 --- a/drivers/bus/sunxi-rsb.c +++ b/drivers/bus/sunxi-rsb.c | |||
@@ -342,13 +342,13 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr, | |||
342 | 342 | ||
343 | ret = _sunxi_rsb_run_xfer(rsb); | 343 | ret = _sunxi_rsb_run_xfer(rsb); |
344 | if (ret) | 344 | if (ret) |
345 | goto out; | 345 | goto unlock; |
346 | 346 | ||
347 | *buf = readl(rsb->regs + RSB_DATA); | 347 | *buf = readl(rsb->regs + RSB_DATA); |
348 | 348 | ||
349 | unlock: | ||
349 | mutex_unlock(&rsb->lock); | 350 | mutex_unlock(&rsb->lock); |
350 | 351 | ||
351 | out: | ||
352 | return ret; | 352 | return ret; |
353 | } | 353 | } |
354 | 354 | ||