Skip to content

Commit 6ee152b

Browse files
committed
wifi: mac80211: simplify __ieee80211_rx_h_amsdu() loop
The loop handling individual subframes can be simplified to not use a somewhat confusing goto inside the loop. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250709233537.a217a1e8c667.I5283df9627912c06c8327b5786d6b715c6f3a4e1@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 63df395 commit 6ee152b

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

net/mac80211/rx.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,7 +3033,6 @@ __ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset)
30333033
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
30343034
__le16 fc = hdr->frame_control;
30353035
struct sk_buff_head frame_list;
3036-
ieee80211_rx_result res;
30373036
struct ethhdr ethhdr;
30383037
const u8 *check_da = ethhdr.h_dest, *check_sa = ethhdr.h_source;
30393038

@@ -3095,24 +3094,18 @@ __ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset)
30953094
while (!skb_queue_empty(&frame_list)) {
30963095
rx->skb = __skb_dequeue(&frame_list);
30973096

3098-
res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb);
3099-
switch (res) {
3097+
switch (ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb)) {
31003098
case RX_QUEUED:
3101-
continue;
3102-
case RX_CONTINUE:
31033099
break;
3100+
case RX_CONTINUE:
3101+
if (ieee80211_frame_allowed(rx, fc)) {
3102+
ieee80211_deliver_skb(rx);
3103+
break;
3104+
}
3105+
fallthrough;
31043106
default:
3105-
goto free;
3107+
dev_kfree_skb(rx->skb);
31063108
}
3107-
3108-
if (!ieee80211_frame_allowed(rx, fc))
3109-
goto free;
3110-
3111-
ieee80211_deliver_skb(rx);
3112-
continue;
3113-
3114-
free:
3115-
dev_kfree_skb(rx->skb);
31163109
}
31173110

31183111
return RX_QUEUED;

0 commit comments

Comments
 (0)