* [PATCH net] net: pch_gbe: fix potential memleak in pch_gbe_tx_queue()
@ 2022-11-17 6:55 Wang Hai
2022-11-18 13:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Wang Hai @ 2022-11-17 6:55 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andriy.shevchenko, liuhangbin, masa-korg
Cc: linux-kernel, netdev
In pch_gbe_xmit_frame(), NETDEV_TX_OK will be returned whether
pch_gbe_tx_queue() sends data successfully or not, so pch_gbe_tx_queue()
needs to free skb before returning. But pch_gbe_tx_queue() returns without
freeing skb in case of dma_map_single() fails. Add dev_kfree_skb_any()
to fix it.
Fixes: 77555ee72282 ("net: Add Gigabit Ethernet driver of Topcliff PCH")
Signed-off-by: Wang Hai <wanghai38@huawei.com>
---
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 3f2c30184752..c9ae47128a07 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -1143,6 +1143,7 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
buffer_info->dma = 0;
buffer_info->time_stamp = 0;
tx_ring->next_to_use = ring_num;
+ dev_kfree_skb_any(skb);
return;
}
buffer_info->mapped = true;
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: pch_gbe: fix potential memleak in pch_gbe_tx_queue()
2022-11-17 6:55 [PATCH net] net: pch_gbe: fix potential memleak in pch_gbe_tx_queue() Wang Hai
@ 2022-11-18 13:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-18 13:10 UTC (permalink / raw)
To: Wang Hai
Cc: davem, edumazet, kuba, pabeni, andriy.shevchenko, liuhangbin,
masa-korg, linux-kernel, netdev
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Thu, 17 Nov 2022 14:55:27 +0800 you wrote:
> In pch_gbe_xmit_frame(), NETDEV_TX_OK will be returned whether
> pch_gbe_tx_queue() sends data successfully or not, so pch_gbe_tx_queue()
> needs to free skb before returning. But pch_gbe_tx_queue() returns without
> freeing skb in case of dma_map_single() fails. Add dev_kfree_skb_any()
> to fix it.
>
> Fixes: 77555ee72282 ("net: Add Gigabit Ethernet driver of Topcliff PCH")
> Signed-off-by: Wang Hai <wanghai38@huawei.com>
>
> [...]
Here is the summary with links:
- [net] net: pch_gbe: fix potential memleak in pch_gbe_tx_queue()
https://git.kernel.org/netdev/net/c/2360f9b8c4e8
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:[~2022-11-18 13:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17 6:55 [PATCH net] net: pch_gbe: fix potential memleak in pch_gbe_tx_queue() Wang Hai
2022-11-18 13:10 ` 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
all inboxes | Powered by JetHome®