Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peter Åstrand and committed by
Johannes Berg
e75665dd 2b77b955

+5
+5
drivers/net/wireless/ti/wlcore/tx.c
··· 207 207 total_blocks = wlcore_hw_calc_tx_blocks(wl, total_len, spare_blocks); 208 208 209 209 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 + } 210 215 desc = skb_push(skb, total_len - skb->len); 211 216 212 217 wlcore_hw_set_tx_desc_blocks(wl, desc, total_blocks,