Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: nl80211: free RNR data on MBSSID mismatch
@ 2026-06-10 11:22 Zhao Li
  0 siblings, 0 replies; only message in thread
From: Zhao Li @ 2026-06-10 11:22 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Aloka Dixit, linux-wireless, linux-kernel

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>
---
 net/wireless/nl80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 76c537a6e8b52..1b4c4440d2abf 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -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;
 		}
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-10 11:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-10 11:22 [PATCH] wifi: nl80211: free RNR data on MBSSID mismatch Zhao Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox