Skip to contentSkip to conversation

wifi: nl80211: free RNR data on MBSSID mismatch

PATCH New Zhao Li 1 participant 1 message Jun 10 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Zhao Li

author
#0 lore raw

PATCH 1/1 wifi: nl80211: free RNR data on MBSSID mismatch

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")
---
 net/wireless/nl80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/wireless/nl80211.c +3 -1
index 76c537a6e8b52..1b4c4440d2abf 100644
@@ -6519,8 +6519,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;
 		}
Signature · 1 line
2.50.1 (Apple Git-155)