Commit baa56dfe authored by Veerendranath Jakkam's avatar Veerendranath Jakkam Committed by Kalle Valo

wifi: cfg80211: Fix validating BSS pointers in __cfg80211_connect_result

Driver's SME is allowed to fill either BSSID or BSS pointers in struct
cfg80211_connect_resp_params when indicating connect response but a
check in __cfg80211_connect_result() is giving unnecessary warning when
driver's SME fills only BSSID pointer and not BSS pointer in struct
cfg80211_connect_resp_params.

In case of mac80211 with auth/assoc path, it is always expected to fill
BSS pointers in struct cfg80211_connect_resp_params when calling
__cfg80211_connect_result() since cfg80211 must have hold BSS pointers
in cfg80211_mlme_assoc().

So, skip the check for the drivers which support cfg80211 connect
callback, for example with brcmfmac is one such driver which had the
warning:

WARNING: CPU: 5 PID: 514 at net/wireless/sme.c:786 __cfg80211_connect_result+0x2fc/0x5c0 [cfg80211]
Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Fixes: efbabc11 ("cfg80211: Indicate MLO connection info in connect and roam callbacks")
Signed-off-by: default avatarVeerendranath Jakkam <quic_vjakkam@quicinc.com>
[kvalo@kernel.org: add more info to the commit log]
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220805135259.4126630-1-quic_vjakkam@quicinc.com
parent ac0dbed9
...@@ -782,10 +782,12 @@ void __cfg80211_connect_result(struct net_device *dev, ...@@ -782,10 +782,12 @@ void __cfg80211_connect_result(struct net_device *dev,
#endif #endif
if (cr->status == WLAN_STATUS_SUCCESS) { if (cr->status == WLAN_STATUS_SUCCESS) {
if (!wiphy_to_rdev(wdev->wiphy)->ops->connect) {
for_each_valid_link(cr, link) { for_each_valid_link(cr, link) {
if (WARN_ON_ONCE(!cr->links[link].bss)) if (WARN_ON_ONCE(!cr->links[link].bss))
break; break;
} }
}
for_each_valid_link(cr, link) { for_each_valid_link(cr, link) {
if (cr->links[link].bss) if (cr->links[link].bss)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment