Skip to content

Commit 786c5be

Browse files
dmantipovjmberg-intel
authored andcommitted
wifi: mac80211: free skb on error path in ieee80211_beacon_get_ap()
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]>
1 parent 3a84454 commit 786c5be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/mac80211/tx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5348,8 +5348,10 @@ ieee80211_beacon_get_ap(struct ieee80211_hw *hw,
53485348
if (beacon->tail)
53495349
skb_put_data(skb, beacon->tail, beacon->tail_len);
53505350

5351-
if (ieee80211_beacon_protect(skb, local, sdata, link) < 0)
5351+
if (ieee80211_beacon_protect(skb, local, sdata, link) < 0) {
5352+
dev_kfree_skb(skb);
53525353
return NULL;
5354+
}
53535355

53545356
ieee80211_beacon_get_finish(hw, vif, link, offs, beacon, skb,
53555357
chanctx_conf, csa_off_base);

0 commit comments

Comments
 (0)