]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: nl80211: free RNR data on MBSSID mismatch
authorZhao Li <enderaoelyther@gmail.com>
Wed, 10 Jun 2026 11:22:09 +0000 (19:22 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 6 Jul 2026 12:11:09 +0000 (14:11 +0200)
nl80211_parse_beacon() rejects EMA RNR data when there are fewer RNR
entries than MBSSID entries.

The rejected RNR allocation has not been attached to the beacon data yet,
so free it before returning the error.

Fixes: dbbb27e183b1 ("cfg80211: support RNR for EMA AP")
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20260610112208.1308-2-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index 53b4b3f7669782ac222a642bed3610fc444b6d10..056388c045994a6cbf50ee19698445e101f75122 100644 (file)
@@ -6803,8 +6803,10 @@ static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev,
                        if (IS_ERR(rnr))
                                return PTR_ERR(rnr);
 
-                       if (rnr && rnr->cnt < bcn->mbssid_ies->cnt)
+                       if (rnr && rnr->cnt < bcn->mbssid_ies->cnt) {
+                               kfree(rnr);
                                return -EINVAL;
+                       }
 
                        bcn->rnr_ies = rnr;
                }