All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] bus: sunxi-rsb: unlock on error in sunxi_rsb_read()
@ 2015-11-03 22:02 ` Dan Carpenter
  0 siblings, 0 replies; 14+ messages in thread
From: Dan Carpenter @ 2015-11-03 22:02 UTC (permalink / raw)
  To: linux-arm-kernel

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>

diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
index 846bc29c..0cfcb39 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,
 
 	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;
 }
 

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-11-05  6:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 22:02 [patch] bus: sunxi-rsb: unlock on error in sunxi_rsb_read() Dan Carpenter
2015-11-03 22:02 ` Dan Carpenter
2015-11-04 12:19 ` walter harms
2015-11-04 12:19   ` walter harms
2015-11-04 12:34   ` Julia Lawall
2015-11-04 12:34     ` Julia Lawall
2015-11-04 12:46   ` Dan Carpenter
2015-11-04 12:46     ` Dan Carpenter
2015-11-04 15:28 ` Chen-Yu Tsai
2015-11-04 15:28   ` Chen-Yu Tsai
2015-11-04 15:51 ` Maxime Ripard
2015-11-04 15:51   ` Maxime Ripard
2015-11-04 21:22 ` walter harms
2015-11-05  6:07 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.