Skip to contentSkip to conversation

brcmfmac: fix uninitialized warning

PATCH New Arend van Spriel 1 participant 1 message Nov 29, 2013 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: fix uninitialized warning

Building brcmfmac for sparc64 gave the following warning:

CC [M] drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.o
bcmsdh_sdmmc.c: In function 'brcmf_sdioh_request_byte':
bcmsdh_sdmmc.c:89:6: warning: 'err_ret' may be used uninitialized
in this function [-Wuninitialized]

Inspecting the code it indeed had a path of execution in which the return value was used uninitialized. This patch fixes that code path.

---
Hi John,

This problem popped up when enabling some more build targets and figured it could be taken for 3.13. Just strange it only showed on sparc64 as the warning seems valid. Anyway, it applies to the wireless master branch.

Regards,
Arend

---
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +2 -0
index 905704e..abc9cec 100644
@@ -109,6 +109,8 @@ static inline int brcmf_sdioh_f0_write_byte(struct brcmf_sdio_dev *sdiodev,
 					brcmf_err("Disable F2 failed:%d\n",
 						  err_ret);
 			}
+		} else {
+			err_ret = -ENOENT;
 		}
 	} else if ((regaddr == SDIO_CCCR_ABORT) ||
 		   (regaddr == SDIO_CCCR_IENx)) {
Signature · 1 line
1.8.1.3