From c0bf40936ae656bd34095caa2e25125daf71dbbd Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Thu, 7 Jul 2022 15:03:51 +0200 Subject: [PATCH] wifi: nl80211: set BSS to NULL if IS_ERR() If the BSS lookup returned an error, set it to NULL so we don't try to free it. Fixes: 9783aa45b589 ("wifi: nl80211: support MLO in auth/assoc") Signed-off-by: Johannes Berg --- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 35fb2b0517d95..b75398f0d5b46 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -10767,6 +10767,7 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info) &bssid); if (IS_ERR(req.links[link_id].bss)) { err = PTR_ERR(req.links[link_id].bss); + req.links[link_id].bss = NULL; goto free; } -- 2.39.5