[PATCH net-next] net: ixp4xx_hss: drop kfree for memory allocated with devm_kzalloc

Subsystems: arm/intel ixp4xx arm architecture, networking drivers, the rest

STALE1718d

2 messages, 2 authors, 2021-11-30 · open the first message on its own page

[PATCH net-next] net: ixp4xx_hss: drop kfree for memory allocated with devm_kzalloc

From: Wei Yongjun <hidden>
Date: 2021-11-30 10:35:45

It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Fixes: 35aefaad326b ("net: ixp4xx_hss: Convert to use DT probing")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
 drivers/net/wan/ixp4xx_hss.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index d02d8a2eb99d..0b7d9f2f2b8b 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -1508,7 +1508,6 @@ static int ixp4xx_hss_remove(struct platform_device *pdev)
 	unregister_hdlc_device(port->netdev);
 	free_netdev(port->netdev);
 	npe_release(port->npe);
-	kfree(port);
 	return 0;
 }
 

Re: [PATCH net-next] net: ixp4xx_hss: drop kfree for memory allocated with devm_kzalloc

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-11-30 12:50:13

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller [off-list ref]:

On Tue, 30 Nov 2021 10:48:40 +0000 you wrote:
It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Fixes: 35aefaad326b ("net: ixp4xx_hss: Convert to use DT probing")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>

[...]
Here is the summary with links:
  - [net-next] net: ixp4xx_hss: drop kfree for memory allocated with devm_kzalloc
    https://git.kernel.org/netdev/net-next/c/196073f9c44b

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help