Skip to content

Commit

Permalink
wifi: mac80211: free skb on error path in ieee80211_beacon_get_ap()
Browse files Browse the repository at this point in the history
In 'ieee80211_beacon_get_ap()', free allocated skb in case of error
returned by 'ieee80211_beacon_protect()'. Compile tested only.

Signed-off-by: Dmitry Antipov <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
dmantipov authored and jmberg-intel committed Aug 26, 2024
1 parent 3a84454 commit 786c5be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -5348,8 +5348,10 @@ ieee80211_beacon_get_ap(struct ieee80211_hw *hw,
if (beacon->tail)
skb_put_data(skb, beacon->tail, beacon->tail_len);

if (ieee80211_beacon_protect(skb, local, sdata, link) < 0)
if (ieee80211_beacon_protect(skb, local, sdata, link) < 0) {
dev_kfree_skb(skb);
return NULL;
}

ieee80211_beacon_get_finish(hw, vif, link, offs, beacon, skb,
chanctx_conf, csa_off_base);
Expand Down

0 comments on commit 786c5be

Please sign in to comment.