[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210812170300.1047330-1-trix@redhat.com>
Date: Thu, 12 Aug 2021 10:03:00 -0700
From: trix@...hat.com
To: aspriel@...il.com, franky.lin@...adcom.com,
hante.meuleman@...adcom.com, chi-hsien.lin@...ineon.com,
wright.feng@...ineon.com, chung-hsien.hsu@...ineon.com,
kvalo@...eaurora.org, davem@...emloft.net, kuba@...nel.org,
zhengyongjun3@...wei.com, linus.walleij@...aro.org,
lee.jones@...aro.org
Cc: linux-wireless@...r.kernel.org,
brcm80211-dev-list.pdl@...adcom.com,
SHA-cyfmac-dev-list@...ineon.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Tom Rix <trix@...hat.com>
Subject: [PATCH] brcmfmac: Fix fallback logic to use firmware's canonical path
From: Tom Rix <trix@...hat.com>
Static analysis reports this problem
firmware.c:709:6: warning: Branch condition evaluates to a garbage value
if (ret) {
^~~
In brcmf_fw_get_firmwares(), ret is only set if the alt_path control
flow is taken. Initialize ret to -1, so the canonical path is taken
if alt_path is not.
Fixes: 5ff013914c62 ("brcmfmac: firmware: Allow per-board firmware binaries")
Signed-off-by: Tom Rix <trix@...hat.com>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
index adfdfc654b104..e11f1a3a38a59 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
@@ -680,7 +680,7 @@ int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req,
struct brcmf_fw_item *first = &req->items[0];
struct brcmf_fw *fwctx;
char *alt_path;
- int ret;
+ int ret = -1;
brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev));
if (!fw_cb)
--
2.26.3
Powered by blists - more mailing lists