Thread (6 messages) 6 messages, 3 authors, 2018-03-17

Re: [PATCH] net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred

flat view

From: David Miller <davem@davemloft.net>
Date: 2018-03-16 19:27:16
Also in: kernel-janitors, linux-arm-kernel, linux-rockchip, lkml

From: Christophe JAILLET <redacted>
Date: Wed, 14 Mar 2018 22:09:34 +0100
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c
index 16f9bee992fe..8ee9dfd0e363 100644
--- a/drivers/net/ethernet/arc/emac_rockchip.c
+++ b/drivers/net/ethernet/arc/emac_rockchip.c
@@ -169,8 +169,10 @@ static int emac_rockchip_probe(struct platform_device *pdev)
 	/* Optional regulator for PHY */
 	priv->regulator = devm_regulator_get_optional(dev, "phy");
 	if (IS_ERR(priv->regulator)) {
-		if (PTR_ERR(priv->regulator) == -EPROBE_DEFER)
-			return -EPROBE_DEFER;
+		if (PTR_ERR(priv->regulator) == -EPROBE_DEFER) {
+			ret = -EPROBE_DEFER;
+			goto out_clk_disable;
+		}
Please build test your changes.

There is no 'ret' variable in this function, perhaps you meant 'err'.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help