brcmfmac: initialize variable in brcmf_sdiod_regrl()
authorArend Van Spriel <arend.vanspriel@broadcom.com>
Mon, 19 Sep 2016 11:09:54 +0000 (12:09 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 26 Sep 2016 17:35:53 +0000 (20:35 +0300)
In case of an error the variable returned is uninitialized. The caller
will probably check the error code before using it, but better assure
it is set to zero.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c

index 03404cbe92374f1310c008dd52b8891b828198d0..72139b579b1892d71a4ff4741ee1ad1bd66478be 100644 (file)
@@ -420,7 +420,7 @@ u8 brcmf_sdiod_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
 
 u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
 {
-       u32 data;
+       u32 data = 0;
        int retval;
 
        brcmf_dbg(SDIO, "addr:0x%08x\n", addr);