[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1668657419-29240-1-git-send-email-zhangchangzhong@huawei.com>
Date: Thu, 17 Nov 2022 11:56:58 +0800
From: Zhang Changzhong <zhangchangzhong@...wei.com>
To: Ajay Singh <ajay.kathat@...rochip.com>,
Claudiu Beznea <claudiu.beznea@...rochip.com>,
Kalle Valo <kvalo@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
"Jakub Kicinski" <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Johnny Kim <johnny.kim@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Chris Park <chris.park@...el.com>,
Rachel Kim <rachel.kim@...el.com>,
"Nicolas Ferre" <nicolas.ferre@...rochip.com>
CC: Zhang Changzhong <zhangchangzhong@...wei.com>,
<linux-wireless@...r.kernel.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH wireless] wilc1000: fix potential memory leak in wilc_mac_xmit()
The wilc_mac_xmit() returns NETDEV_TX_OK without freeing skb, add
dev_kfree_skb() to fix it.
Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Zhang Changzhong <zhangchangzhong@...wei.com>
---
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
Powered by blists - more mailing lists