UPSTREAM: 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: d648c23024bd ("wifi: nl80211: support MLO in auth/assoc")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 253289327
Change-Id: I07544dc0867c37bacb1529b238043b50c5766f2e
(cherry picked from commit 9b6bf4d6120adfe8c631830dbe1c7c6c64e07ce5)
Signed-off-by: Kiran Kumar Lokere <quic_klokere@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
This commit is contained in:
Johannes Berg
2022-07-07 15:03:51 +02:00
committed by Todd Kjos
parent d9847463ac
commit 85f1514d21

View File

@@ -10824,6 +10824,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;
}