Skip to content

Commit e75665d

Browse files
astrandjmberg-intel
authored andcommitted
wifi: wlcore: ensure skb headroom before skb_push
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>
1 parent 2b77b95 commit e75665d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • drivers/net/wireless/ti/wlcore

drivers/net/wireless/ti/wlcore/tx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif,
207207
total_blocks = wlcore_hw_calc_tx_blocks(wl, total_len, spare_blocks);
208208

209209
if (total_blocks <= wl->tx_blocks_available) {
210+
if (skb_headroom(skb) < (total_len - skb->len) &&
211+
pskb_expand_head(skb, (total_len - skb->len), 0, GFP_ATOMIC)) {
212+
wl1271_free_tx_id(wl, id);
213+
return -EAGAIN;
214+
}
210215
desc = skb_push(skb, total_len - skb->len);
211216

212217
wlcore_hw_set_tx_desc_blocks(wl, desc, total_blocks,

0 commit comments

Comments
 (0)