[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200914041229.GA1600388@ubuntu-n2-xlarge-x86>
Date: Sun, 13 Sep 2020 21:12:29 -0700
From: Nathan Chancellor <natechancellor@...il.com>
To: trix@...hat.com
Cc: arend.vanspriel@...adcom.com, franky.lin@...adcom.com,
hante.meuleman@...adcom.com, chi-hsien.lin@...ress.com,
wright.feng@...ress.com, kvalo@...eaurora.org, davem@...emloft.net,
kuba@...nel.org, ndesaulniers@...gle.com, smoch@....de,
dan.carpenter@...cle.com, double.lo@...ress.com, digetx@...il.com,
frank.kao@...ress.com, amsr@...ress.com, stanley.hsu@...ress.com,
saravanan.shanmugham@...ress.com, jean-philippe@...aro.org,
linville@...driver.com, linux-wireless@...r.kernel.org,
brcm80211-dev-list.pdl@...adcom.com,
brcm80211-dev-list@...ress.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com
Subject: Re: [PATCH] brcmfmac: initialize variable
On Sun, Sep 13, 2020 at 07:35:22AM -0700, trix@...hat.com wrote:
> From: Tom Rix <trix@...hat.com>
>
> clang static analysis flags this problem
> sdio.c:3265:13: warning: Branch condition evaluates to
> a garbage value
> } else if (pending) {
> ^~~~~~~
>
> brcmf_sdio_dcmd_resp_wait() only sets pending to true.
> So pending needs to be initialized to false.
>
> Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers")
> Signed-off-by: Tom Rix <trix@...hat.com>
Reviewed-by: Nathan Chancellor <natechancellor@...il.com>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> index d4989e0cd7be..403b123710ec 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> @@ -3233,7 +3233,7 @@ brcmf_sdio_bus_rxctl(struct device *dev, unsigned char *msg, uint msglen)
> {
> int timeleft;
> uint rxlen = 0;
> - bool pending;
> + bool pending = false;
> u8 *buf;
> struct brcmf_bus *bus_if = dev_get_drvdata(dev);
> struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
> --
> 2.18.1
>
Powered by blists - more mailing lists