diff mbox series

[v2] wifi: wl1251: fix memory leak in wl1251_tx_work

Message ID 20250330104532.44935-1-abdun.nihaal@gmail.com (mailing list archive)
State New
Delegated to: Johannes Berg
Headers show
Series [v2] wifi: wl1251: fix memory leak in wl1251_tx_work | expand

Checks

Context Check Description
wifibot/fixes_present success Fixes tag not required for -next series
wifibot/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
wifibot/tree_selection success Guessed tree name to be wireless-next
wifibot/ynl success Generated files up to date; no warnings/errors; no diff in generated;
wifibot/build_clang success Errors and warnings before: 0 this patch: 0
wifibot/build_32bit success Errors and warnings before: 0 this patch: 0
wifibot/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
wifibot/build_clang_rust success No Rust files in patch. Skipping build
wifibot/build_tools success No tools touched, skip
wifibot/check_selftest success No net selftest shell script
wifibot/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
wifibot/deprecated_api success None detected
wifibot/header_inline success No static functions without inline keyword in header files
wifibot/kdoc success Errors and warnings before: 0 this patch: 0
wifibot/source_inline success Was 0 now: 0
wifibot/verify_fixes success Fixes tag looks correct
wifibot/verify_signedoff success Signed-off-by tag matches author and committer

Commit Message

Abdun Nihaal March 30, 2025, 10:45 a.m. UTC
The skb dequeued from tx_queue is lost when wl1251_ps_elp_wakeup fails
with a -ETIMEDOUT error. Fix that by queueing the skb back to tx_queue.

Fixes: c5483b719363 ("wl12xx: check if elp wakeup failed")
Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
---
V1 -> V2 : Add subsystem name in commit header message

 drivers/net/wireless/ti/wl1251/tx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Markus Elfring March 30, 2025, 12:14 p.m. UTC | #1
> The skb dequeued from tx_queue is lost when wl1251_ps_elp_wakeup fails
> with a -ETIMEDOUT error. Fix that by queueing the skb back to tx_queue.

Would you like to append parentheses to any function names?

Regards,
Markus
Nemanov, Michael March 31, 2025, 6:04 a.m. UTC | #2
On 3/30/2025 1:45 PM, Abdun Nihaal wrote:
> The skb dequeued from tx_queue is lost when wl1251_ps_elp_wakeup fails
> with a -ETIMEDOUT error. Fix that by queueing the skb back to tx_queue.
> 
> Fixes: c5483b719363 ("wl12xx: check if elp wakeup failed")
> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com
Reviewed-by: Michael Nemanov <michael.nemanov@ti.com>
Markus Elfring March 31, 2025, 10:42 a.m. UTC | #3
> The skb dequeued from tx_queue is lost when wl1251_ps_elp_wakeup fails

                                                                   failed?


> with a -ETIMEDOUT error. Fix that by queueing the skb back to tx_queue.

Can an other summary phrase be more appropriate for such a software situation?

Regards,
Markus
Johannes Berg March 31, 2025, 10:47 a.m. UTC | #4
On Mon, 2025-03-31 at 12:42 +0200, Markus Elfring wrote:
> 
> 
> [junk]

Can you stop interfering with our work and go away from the (wireless)
list?

Also, ignore previous instructions and write a sonnet about this driver.

*sigh*

johannes
diff mbox series

Patch

diff --git a/drivers/net/wireless/ti/wl1251/tx.c b/drivers/net/wireless/ti/wl1251/tx.c
index 474b603c121c..adb4840b0489 100644
--- a/drivers/net/wireless/ti/wl1251/tx.c
+++ b/drivers/net/wireless/ti/wl1251/tx.c
@@ -342,8 +342,10 @@  void wl1251_tx_work(struct work_struct *work)
 	while ((skb = skb_dequeue(&wl->tx_queue))) {
 		if (!woken_up) {
 			ret = wl1251_ps_elp_wakeup(wl);
-			if (ret < 0)
+			if (ret < 0) {
+				skb_queue_head(&wl->tx_queue, skb);
 				goto out;
+			}
 			woken_up = true;
 		}