]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: wl1251: fix memory leak in wl1251_tx_work
authorAbdun Nihaal <abdun.nihaal@gmail.com>
Sun, 30 Mar 2025 10:45:32 +0000 (16:15 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 2 Apr 2025 10:57:50 +0000 (12:57 +0200)
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>
Link: https://patch.msgid.link/20250330104532.44935-1-abdun.nihaal@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ti/wl1251/tx.c

index 474b603c121cba85a863508f2185f440cc75b2e7..adb4840b048932c2f9d9a2211c7930d51c47281b 100644 (file)
@@ -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;
                }