Skip to contentSkip to conversation

wifi: rtw89: free unused skb to prevent memory leak

PATCH In review Ping-Ke Shih 2 participants 3 messages Sep 26, 2022

Subsystems (2)
lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 wifi: rtw89: free unused skb to prevent memory leak

From: Po-Hao Huang <[email protected]>

This avoid potential memory leak under power saving mode.

Fixes fc5f311fce74 ("rtw89: don't flush hci queues and send h2c if power is off")
Cc Larry Finger <[email protected]>

---
Hi Kalle,

We want this patch go to v6.0-rc, because it can fix memleak caused by another patch. For users, this driver eats memory and could lead out-of-memory finally.

This patch has been merged into wireless-next, but I forget to add "Fixes" tag and Cc stable, so I add them to commit messages. If this works, I will prepare another patch for v5.19.

Ping-Ke

---
 drivers/net/wireless/realtek/rtw89/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtw89/core.c +1 -0
index 16c74477b3325..e3086bf8f4513 100644
@@ -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;
 	}
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 14 lines · Ping-Ke Shih

From: Po-Hao Huang <[email protected]>

This avoid potential memory leak under power saving mode.

Fixes fc5f311fce74 ("rtw89: don't flush hci queues and send h2c if power is off")
Cc Larry Finger <[email protected]>

---
Hi Kalle,

Quoted 7 lines

We want this patch go to v6.0-rc, because it can fix memleak caused by another patch. For users, this driver eats memory and could lead out-of-memory finally.

This patch has been merged into wireless-next, but I forget to add "Fixes" tag and Cc stable, so I add them to commit messages. If this works, I will prepare another patch for v5.19.

-rc7 is already released, so we are quite late in the cycle, and I'm not planning to submit another pull request for v6.0 unless something really major happens. So I think it's better that you wait for the -next commit to reach Linus' tree (should happen in next two weeks or so) and then submit a patch to stable releases.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
author maintainer
#2 lore raw
Quoted 33 lines

-----Original Message-----
From: Kalle Valo <[email protected]>
Sent: Monday, September 26, 2022 1:27 PM
To: Ping-Ke Shih <[email protected]>
Cc: [email protected]; [email protected]; Bernie Huang <[email protected]>; [email protected]
Subject: Re: [PATCH v6.0-rc] wifi: rtw89: free unused skb to prevent memory leak

Quoted 14 lines · Ping-Ke Shih

From: Po-Hao Huang <[email protected]>

This avoid potential memory leak under power saving mode.

Fixes fc5f311fce74 ("rtw89: don't flush hci queues and send h2c if power is off")
Cc Larry Finger <[email protected]>

---
Hi Kalle,

Quoted 7 lines

We want this patch go to v6.0-rc, because it can fix memleak caused by another patch. For users, this driver eats memory and could lead out-of-memory finally.

This patch has been merged into wireless-next, but I forget to add "Fixes" tag and Cc stable, so I add them to commit messages. If this works, I will prepare another patch for v5.19.

Quoted 6 lines

-rc7 is already released, so we are quite late in the cycle, and I'm not planning to submit another pull request for v6.0 unless something really major happens. So I think it's better that you wait for the -next commit to reach Linus' tree (should happen in next two weeks or so) and then submit a patch to stable releases.

Got it. I will do it weeks later. Thanks.

Ping-Ke