2020-12-20 08:33:39

by Dinghao Liu

[permalink] [raw]
Subject: [PATCH] net: ethernet: mvneta: Fix error handling in mvneta_probe

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 <[email protected]>
---
drivers/net/ethernet/marvell/mvneta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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
--
2.17.1


2020-12-23 03:31:52

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] net: ethernet: mvneta: Fix error handling in mvneta_probe

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 <[email protected]>
> ---
> 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