* [PATCH net] net/sun3_82586: fix potential memory leak in sun3_82586_send_packet()
@ 2024-10-15 14:41 Wang Hai
2024-10-16 13:49 ` Simon Horman
2024-10-20 14:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Wang Hai @ 2024-10-15 14:41 UTC (permalink / raw)
To: sammy, davem, edumazet, kuba, pabeni, zhangxiaoxu5
Cc: netdev, linux-kernel, wanghai38
The sun3_82586_send_packet() returns NETDEV_TX_OK without freeing skb
in case of skb->len being too long, add dev_kfree_skb() to fix it.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Wang Hai <wanghai38@huawei.com>
---
drivers/net/ethernet/i825xx/sun3_82586.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/i825xx/sun3_82586.c b/drivers/net/ethernet/i825xx/sun3_82586.c
index f2d4669c81cf..58a3d28d938c 100644
--- a/drivers/net/ethernet/i825xx/sun3_82586.c
+++ b/drivers/net/ethernet/i825xx/sun3_82586.c
@@ -1012,6 +1012,7 @@ sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
if(skb->len > XMIT_BUFF_SIZE)
{
printk("%s: Sorry, max. framelength is %d bytes. The length of your frame is %d bytes.\n",dev->name,XMIT_BUFF_SIZE,skb->len);
+ dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net/sun3_82586: fix potential memory leak in sun3_82586_send_packet()
2024-10-15 14:41 [PATCH net] net/sun3_82586: fix potential memory leak in sun3_82586_send_packet() Wang Hai
@ 2024-10-16 13:49 ` Simon Horman
2024-10-20 14:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-10-16 13:49 UTC (permalink / raw)
To: Wang Hai
Cc: sammy, davem, edumazet, kuba, pabeni, zhangxiaoxu5, netdev,
linux-kernel
On Tue, Oct 15, 2024 at 10:41:48PM +0800, Wang Hai wrote:
> The sun3_82586_send_packet() returns NETDEV_TX_OK without freeing skb
> in case of skb->len being too long, add dev_kfree_skb() to fix it.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Wang Hai <wanghai38@huawei.com>
> ---
> drivers/net/ethernet/i825xx/sun3_82586.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/i825xx/sun3_82586.c b/drivers/net/ethernet/i825xx/sun3_82586.c
> index f2d4669c81cf..58a3d28d938c 100644
> --- a/drivers/net/ethernet/i825xx/sun3_82586.c
> +++ b/drivers/net/ethernet/i825xx/sun3_82586.c
> @@ -1012,6 +1012,7 @@ sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
> if(skb->len > XMIT_BUFF_SIZE)
> {
> printk("%s: Sorry, max. framelength is %d bytes. The length of your frame is %d bytes.\n",dev->name,XMIT_BUFF_SIZE,skb->len);
> + dev_kfree_skb(skb);
> return NETDEV_TX_OK;
> }
Thanks,
I agree that:
* This code-change is correct,
* and in keeping with other code in this function.
* And I agree that this problem goes back to the beginning of git history
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net/sun3_82586: fix potential memory leak in sun3_82586_send_packet()
2024-10-15 14:41 [PATCH net] net/sun3_82586: fix potential memory leak in sun3_82586_send_packet() Wang Hai
2024-10-16 13:49 ` Simon Horman
@ 2024-10-20 14:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-20 14:50 UTC (permalink / raw)
To: Wang Hai
Cc: sammy, davem, edumazet, kuba, pabeni, zhangxiaoxu5, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Andrew Lunn <andrew@lunn.ch>:
On Tue, 15 Oct 2024 22:41:48 +0800 you wrote:
> The sun3_82586_send_packet() returns NETDEV_TX_OK without freeing skb
> in case of skb->len being too long, add dev_kfree_skb() to fix it.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Wang Hai <wanghai38@huawei.com>
> ---
> drivers/net/ethernet/i825xx/sun3_82586.c | 1 +
> 1 file changed, 1 insertion(+)
Here is the summary with links:
- [net] net/sun3_82586: fix potential memory leak in sun3_82586_send_packet()
https://git.kernel.org/netdev/net/c/2cb3f56e827a
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] 3+ messages in thread
end of thread, other threads:[~2024-10-20 14:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-15 14:41 [PATCH net] net/sun3_82586: fix potential memory leak in sun3_82586_send_packet() Wang Hai
2024-10-16 13:49 ` Simon Horman
2024-10-20 14:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).