Skip to contentSkip to conversation

net: stmmac: fix leaks in probe

PATCH Applied Dan Carpenter 2 participants 2 messages Jul 12, 2022 – Jul 13, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: fix leaks in probe

These two error paths should clean up before returning.

Fixes 2bb4b98b60d7 ("net: stmmac: Add Ingenic SoCs MAC support.")

---
From static analysis, not tested.

 drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +4 -2
index 9a6d819b84ae..378b4dd826bb 100644
@@ -273,7 +273,8 @@ static int ingenic_mac_probe(struct platform_device *pdev)
 			mac->tx_delay = tx_delay_ps * 1000;
 		} else {
 			dev_err(&pdev->dev, "Invalid TX clock delay: %dps\n", tx_delay_ps);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto err_remove_config_dt;
 		}
 	}
 
@@ -283,7 +284,8 @@ static int ingenic_mac_probe(struct platform_device *pdev)
 			mac->rx_delay = rx_delay_ps * 1000;
 		} else {
 			dev_err(&pdev->dev, "Invalid RX clock delay: %dps\n", rx_delay_ps);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto err_remove_config_dt;
 		}
 	}
 
Signature · 1 line
2.35.1
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Tue, 12 Jul 2022 17:42:25 +0300 you wrote:

These two error paths should clean up before returning.

Fixes 2bb4b98b60d7 ("net: stmmac: Add Ingenic SoCs MAC support.")

---
From static analysis, not tested.

[...]

Here is the summary with links:
- [net] net: stmmac: fix leaks in probe

    https://git.kernel.org/netdev/net/c/23aa6d5088e3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html