diff mbox series

[5/7] wifi: rtw89: free unused skb to prevent memory leak

Message ID 20220916033811.13862-6-pkshih@realtek.com (mailing list archive)
State Accepted
Commit eae672f386049146058b9e5d3d33e9e4af9dca1d
Delegated to: Kalle Valo
Headers show
Series wifi: rtw89: correct MAC and TX descriptor settings | expand

Commit Message

Ping-Ke Shih Sept. 16, 2022, 3:38 a.m. UTC
From: Po-Hao Huang <phhuang@realtek.com>

This avoid potential memory leak under power saving mode.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/core.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index c7405cb9ceb77..b8ce1962ba063 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -847,6 +847,7 @@  int rtw89_h2c_tx(struct rtw89_dev *rtwdev,
 		rtw89_debug(rtwdev, RTW89_DBG_FW,
 			    "ignore h2c due to power is off with firmware state=%d\n",
 			    test_bit(RTW89_FLAG_FW_RDY, rtwdev->flags));
+		dev_kfree_skb(skb);
 		return 0;
 	}