Skip to content

Commit

Permalink
bus: sunxi-rsb: unlock on error in sunxi_rsb_read()
Browse files Browse the repository at this point in the history
Don't forget to unlock before returning an error code.

Fixes: d787dcd ('bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus')
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Chen-Yu Tsai <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
  • Loading branch information
Dan Carpenter authored and mripard committed Nov 17, 2015
1 parent c65d235 commit 43675ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/bus/sunxi-rsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,13 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,

ret = _sunxi_rsb_run_xfer(rsb);
if (ret)
goto out;
goto unlock;

*buf = readl(rsb->regs + RSB_DATA);

unlock:
mutex_unlock(&rsb->lock);

out:
return ret;
}

Expand Down

0 comments on commit 43675ff

Please sign in to comment.