Skip to content
/ linux Public

Commit 46c670f

Browse files
groeckgregkh
authored andcommitted
wifi: wlcore: Return -ENOMEM instead of -EAGAIN if there is not enough headroom
[ Upstream commit deb353d ] Since upstream commit e75665d ("wifi: wlcore: ensure skb headroom before skb_push"), wl1271_tx_allocate() and with it wl1271_prepare_tx_frame() returns -EAGAIN if pskb_expand_head() fails. However, in wlcore_tx_work_locked(), a return value of -EAGAIN from wl1271_prepare_tx_frame() is interpreted as the aggregation buffer being full. This causes the code to flush the buffer, put the skb back at the head of the queue, and immediately retry the same skb in a tight while loop. Because wlcore_tx_work_locked() holds wl->mutex, and the retry happens immediately with GFP_ATOMIC, this will result in an infinite loop and a CPU soft lockup. Return -ENOMEM instead so the packet is dropped and the loop terminates. The problem was found by an experimental code review agent based on gemini-3.1-pro while reviewing backports into v6.18.y. Assisted-by: Gemini:gemini-3.1-pro Fixes: e75665d ("wifi: wlcore: ensure skb headroom before skb_push") Cc: Peter Astrand <astrand@lysator.liu.se> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://patch.msgid.link/20260318064636.3065925-1-linux@roeck-us.net Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 44699c6 commit 46c670f

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/wireless/ti/wlcore

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif,
210210
if (skb_headroom(skb) < (total_len - skb->len) &&
211211
pskb_expand_head(skb, (total_len - skb->len), 0, GFP_ATOMIC)) {
212212
wl1271_free_tx_id(wl, id);
213-
return -EAGAIN;
213+
return -ENOMEM;
214214
}
215215
desc = skb_push(skb, total_len - skb->len);
216216

0 commit comments

Comments
 (0)