Message ID | 20211130104840.1767981-1-weiyongjun1@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 196073f9c44be0b4758ead11e51bc2875f98df29 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: ixp4xx_hss: drop kfree for memory allocated with devm_kzalloc | expand |
Hello: This patch was applied to netdev/net-next.git (master) by David S. Miller <davem@davemloft.net>: 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 <hulkci@huawei.com> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> > > [...] 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!
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; }
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 <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> --- drivers/net/wan/ixp4xx_hss.c | 1 - 1 file changed, 1 deletion(-)