2020-09-14 05:27:05

by Arend Van Spriel

[permalink] [raw]
Subject: Re: [PATCH] brcmfmac: initialize variable

On September 13, 2020 4:35:44 PM [email protected] wrote:

> From: Tom Rix <[email protected]>
>
> 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.

True. However, I prefer to fix it in brcmf_sdio_dcmd_resp_wait() and say:

*pending = signal_pending(current);

Regards,
Arend

> Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers")
> Signed-off-by: Tom Rix <[email protected]>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)




Attachments:
smime.p7s (4.08 kB)
S/MIME Cryptographic Signature