All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: ethernet: mvneta: Fix error handling in mvneta_probe
@ 2020-12-20  8:29 Dinghao Liu
  2020-12-23  3:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-12-20  8:29 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Thomas Petazzoni, David S. Miller, Jakub Kicinski, Russell King,
	Sascha Hauer, netdev, linux-kernel

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(-)

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


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

* Re: [PATCH] net: ethernet: mvneta: Fix error handling in mvneta_probe
  2020-12-20  8:29 [PATCH] net: ethernet: mvneta: Fix error handling in mvneta_probe Dinghao Liu
@ 2020-12-23  3:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-12-23  3:30 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: kjlu, thomas.petazzoni, davem, kuba, rmk+kernel, s.hauer, netdev,
	linux-kernel

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



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

end of thread, other threads:[~2020-12-23  3:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-20  8:29 [PATCH] net: ethernet: mvneta: Fix error handling in mvneta_probe Dinghao Liu
2020-12-23  3:30 ` patchwork-bot+netdevbpf

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.