linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] brcmfmac: firmware: Fix uninitialized variable ret
@ 2021-08-03 15:09 Colin King
  2021-08-03 19:14 ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Colin King @ 2021-08-03 15:09 UTC (permalink / raw)
  To: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-hsien Lin,
	Wright Feng, Chung-hsien Hsu, Kalle Valo, David S . Miller,
	Jakub Kicinski, Linus Walleij, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the variable ret is uninitialized and is only set if
the pointer alt_path is non-null. Fix this by ininitializing ret
to zero.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 5ff013914c62 ("brcmfmac: firmware: Allow per-board firmware binaries")
Signed-off-by: Colin Ian King <colin.king@canonical.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 adfdfc654b10..4f387e868120 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 = 0;
 
 	brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev));
 	if (!fw_cb)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-06 12:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 15:09 [PATCH][next] brcmfmac: firmware: Fix uninitialized variable ret Colin King
2021-08-03 19:14 ` Linus Walleij
2021-08-05 13:53   ` Kalle Valo
2021-08-06 11:23     ` Arend van Spriel
2021-08-06 11:28       ` Colin Ian King
2021-08-06 12:35         ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).