wifi: brcmfmac: do not cast hidden SSID attribute value to boolean
authorAlexey Berezhok <a@bayrepo.ru>
Thu, 8 Feb 2024 08:51:21 +0000 (11:51 +0300)
committerKalle Valo <kvalo@kernel.org>
Mon, 12 Feb 2024 15:38:45 +0000 (17:38 +0200)
In 'brcmf_cfg80211_start_ap()', not assume that
NL80211_HIDDEN_SSID_NOT_IN_USE is zero but prefer
an explicit check instead. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Alexey Berezhok <a@bayrepo.ru>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240208085121.2430-1-a@bayrepo.ru
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

index d0cb392..adf8a14 100644 (file)
@@ -5274,7 +5274,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
                                              settings->hidden_ssid);
                if (err) {
                        bphy_err(drvr, "%s closednet error (%d)\n",
-                                settings->hidden_ssid ?
+                                (settings->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE) ?
                                 "enabled" : "disabled",
                                 err);
                        goto exit;