linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH wireless v2] wilc1000: fix potential memory leak in wilc_mac_xmit()
@ 2022-11-17 11:36 Zhang Changzhong
  2022-12-22 16:06 ` [wireless,v2] wifi: " Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Changzhong @ 2022-11-17 11:36 UTC (permalink / raw)
  To: Ajay Singh, Claudiu Beznea, Kalle Valo, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Johnny Kim,
	Greg Kroah-Hartman, Chris Park, Rachel Kim, Nicolas Ferre
  Cc: Zhang Changzhong, linux-wireless, netdev, linux-kernel

The wilc_mac_xmit() returns NETDEV_TX_OK without freeing skb, add
dev_kfree_skb() to fix it. Compile tested only.

Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
v1->v2: add "Compile tested only" to commit log

 drivers/net/wireless/microchip/wilc1000/netdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c
index 9b319a4..6f3ae0d 100644
--- a/drivers/net/wireless/microchip/wilc1000/netdev.c
+++ b/drivers/net/wireless/microchip/wilc1000/netdev.c
@@ -730,6 +730,7 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 
 	if (skb->dev != ndev) {
 		netdev_err(ndev, "Packet not destined to this device\n");
+		dev_kfree_skb(skb);
 		return NETDEV_TX_OK;
 	}
 
-- 
2.9.5


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

* Re: [wireless,v2] wifi: wilc1000: fix potential memory leak in wilc_mac_xmit()
  2022-11-17 11:36 [PATCH wireless v2] wilc1000: fix potential memory leak in wilc_mac_xmit() Zhang Changzhong
@ 2022-12-22 16:06 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-12-22 16:06 UTC (permalink / raw)
  To: Zhang Changzhong
  Cc: Ajay Singh, Claudiu Beznea, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Johnny Kim, Greg Kroah-Hartman,
	Chris Park, Rachel Kim, Nicolas Ferre, Zhang Changzhong,
	linux-wireless, netdev, linux-kernel

Zhang Changzhong <zhangchangzhong@huawei.com> wrote:

> The wilc_mac_xmit() returns NETDEV_TX_OK without freeing skb, add
> dev_kfree_skb() to fix it. Compile tested only.
> 
> Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>

Patch applied to wireless-next.git, thanks.

deb962ec9e1c wifi: wilc1000: fix potential memory leak in wilc_mac_xmit()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/1668684964-48622-1-git-send-email-zhangchangzhong@huawei.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2022-12-22 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17 11:36 [PATCH wireless v2] wilc1000: fix potential memory leak in wilc_mac_xmit() Zhang Changzhong
2022-12-22 16:06 ` [wireless,v2] wifi: " Kalle Valo

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