diff mbox series

net: ethernet: mvneta: Fix error handling in mvneta_probe

Message ID 20201220082930.21623-1-dinghao.liu@zju.edu.cn
State New
Headers show
Series net: ethernet: mvneta: Fix error handling in mvneta_probe | expand

Commit Message

Dinghao Liu Dec. 20, 2020, 8:29 a.m. UTC
When mvneta_port_power_up() fails, we should execute
cleanup functions after label err_netdev to avoid memleak.

Fixes: 41c2b6b4f0f80 ("net: ethernet: mvneta: Add back interface mode validation")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 23, 2020, 3:30 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun, 20 Dec 2020 16:29:30 +0800 you wrote:
> When mvneta_port_power_up() fails, we should execute

> cleanup functions after label err_netdev to avoid memleak.

> 

> Fixes: 41c2b6b4f0f80 ("net: ethernet: mvneta: Add back interface mode validation")

> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

> ---

>  drivers/net/ethernet/marvell/mvneta.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)


Here is the summary with links:
  - net: ethernet: mvneta: Fix error handling in mvneta_probe
    https://git.kernel.org/netdev/net/c/58f60329a6be

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 563ceac3060f..3369ec717a51 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -5255,7 +5255,7 @@  static int mvneta_probe(struct platform_device *pdev)
 	err = mvneta_port_power_up(pp, pp->phy_interface);
 	if (err < 0) {
 		dev_err(&pdev->dev, "can't power up port\n");
-		return err;
+		goto err_netdev;
 	}
 
 	/* Armada3700 network controller does not support per-cpu