]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: mac80211: free skb on error path in ieee80211_beacon_get_ap()
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 5 Aug 2024 14:20:35 +0000 (17:20 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 26 Aug 2024 15:45:45 +0000 (17:45 +0200)
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>
net/mac80211/tx.c

index edba4a31844fb6251f35e249ea59ea74e951de2f..bca7b341dd772db864d4ca821013e4ade70ebad5 100644 (file)
@@ -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);