diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2024-08-05 17:20:35 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-08-26 17:45:45 +0200 |
commit | 786c5be9ac29a39b6f37f1fdd2ea59d0fe35d525 (patch) | |
tree | 7a8a2eb27397cdf2f7870bf42e490cebd3cff6d0 /net/mac80211 | |
parent | 3a84454f5204718ca5b4ad2c1f0bf2031e2403d1 (diff) | |
download | linux-786c5be9ac29a39b6f37f1fdd2ea59d0fe35d525.tar.gz linux-786c5be9ac29a39b6f37f1fdd2ea59d0fe35d525.tar.bz2 linux-786c5be9ac29a39b6f37f1fdd2ea59d0fe35d525.zip |
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 <dmantipov@yandex.ru>
Link: https://patch.msgid.link/20240805142035.227847-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/tx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index edba4a31844f..bca7b341dd77 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -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); |