Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
"wpa_auth", &val);
if (err) {
bphy_err(drvr, "could not get wpa_auth (%d)\n", err);
return err;
profile->is_okc = false; // If we couldn't ask the chip if OKC is supported, assume it is NOT supported and do not try to use it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how profile->is_okc could be true at this point. It is explictly set to false just 8 llines above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return must not be removed otherwise val might be used without initialization

}
if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
switch (sme->crypto.akm_suites[0]) {
Expand Down Expand Up @@ -1938,6 +1938,7 @@ brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
&okc_enable);
if (err) {
bphy_err(drvr, "get okc_enable failed (%d)\n", err);
profile->is_okc = false; // Again, set state so it does not try OKC if not allowed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, I do not see how this could make a difference. profile->is_okc is set to false at the beginning of this function and the places there it might be set to true are the two profile->is_okc = okc_enable; after querying "okc_enable" in lin 1944 and 1956

} else {
brcmf_dbg(INFO, "get okc_enable (%d)\n", okc_enable);
profile->is_okc = okc_enable;
Expand All @@ -1949,6 +1950,7 @@ brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
&okc_enable);
if (err) {
bphy_err(drvr, "get okc_enable failed (%d)\n", err);
profile->is_okc = false; // Again set state
} else {
brcmf_dbg(INFO, "get okc_enable (%d)\n", okc_enable);
profile->is_okc = okc_enable;
Expand Down