Skip to content

Commit d3532ea

Browse files
arndbKalle Valo
authored andcommitted
brcmfmac: avoid maybe-uninitialized warning in brcmf_cfg80211_start_ap
A bugfix added a sanity check around the assignment and use of the 'is_11d' variable, which looks correct to me, but as the function is rather complex already, this confuses the compiler to the point where it can no longer figure out if the variable is always initialized correctly: brcm80211/brcmfmac/cfg80211.c: In function ‘brcmf_cfg80211_start_ap’: brcm80211/brcmfmac/cfg80211.c:4586:10: error: ‘is_11d’ may be used uninitialized in this function [-Werror=maybe-uninitialized] This adds an initialization for the newly introduced case in which the variable should not really be used, in order to make the warning go away. Fixes: b3589df ("brcmfmac: ignore 11d configuration errors") Cc: Hante Meuleman <hante.meuleman@broadcom.com> Cc: Arend van Spriel <arend.vanspriel@broadcom.com> Cc: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent e604d91 commit d3532ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4516,7 +4516,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
45164516
/* store current 11d setting */
45174517
if (brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_REGULATORY,
45184518
&ifp->vif->is_11d)) {
4519-
supports_11d = false;
4519+
is_11d = supports_11d = false;
45204520
} else {
45214521
country_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail,
45224522
settings->beacon.tail_len,

0 commit comments

Comments
 (0)