]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: wlcore: ensure skb headroom before skb_push
authorPeter Åstrand <astrand@lysator.liu.se>
Wed, 3 Dec 2025 07:57:08 +0000 (08:57 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 16 Dec 2025 09:23:06 +0000 (10:23 +0100)
This avoids occasional skb_under_panic Oops from wl1271_tx_work. In this case, headroom is
less than needed (typically 110 - 94 = 16 bytes).

Signed-off-by: Peter Astrand <astrand@lysator.liu.se>
Link: https://patch.msgid.link/097bd417-e1d7-acd4-be05-47b199075013@lysator.liu.se
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ti/wlcore/tx.c

index f76087be2f758ea83320bb643272f4bd852f2ad2..6241866d39df6d9d051af555aa5f2fde218dcbfb 100644 (file)
@@ -207,6 +207,11 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif,
        total_blocks = wlcore_hw_calc_tx_blocks(wl, total_len, spare_blocks);
 
        if (total_blocks <= wl->tx_blocks_available) {
+               if (skb_headroom(skb) < (total_len - skb->len) &&
+                   pskb_expand_head(skb, (total_len - skb->len), 0, GFP_ATOMIC)) {
+                       wl1271_free_tx_id(wl, id);
+                       return -EAGAIN;
+               }
                desc = skb_push(skb, total_len - skb->len);
 
                wlcore_hw_set_tx_desc_blocks(wl, desc, total_blocks,