All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] brcmfmac: uninitialized variable in brcmf_fw_get_firmwares()
@ 2021-08-04  8:23 Dan Carpenter
  2021-08-04  9:39 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-08-04  8:23 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: Franky Lin, Hante Meuleman, Chi-hsien Lin, Wright Feng,
	Chung-hsien Hsu, Kalle Valo, Lee Jones, Zheng Yongjun,
	Linus Walleij, linux-wireless, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list, kernel-janitors

The "ret" variable is used without being initialized when "alt_path" is
false.

Fixes: 5ff013914c62 ("brcmfmac: firmware: Allow per-board firmware binaries")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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.20.1


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

* Re: [PATCH] brcmfmac: uninitialized variable in brcmf_fw_get_firmwares()
  2021-08-04  8:23 [PATCH] brcmfmac: uninitialized variable in brcmf_fw_get_firmwares() Dan Carpenter
@ 2021-08-04  9:39 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2021-08-04  9:39 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-hsien Lin,
	Wright Feng, Chung-hsien Hsu, Kalle Valo, Lee Jones,
	Zheng Yongjun, linux-wireless, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list, kernel-janitors

On Wed, Aug 4, 2021 at 10:24 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:

> The "ret" variable is used without being initialized when "alt_path" is
> false.
>
> Fixes: 5ff013914c62 ("brcmfmac: firmware: Allow per-board firmware binaries")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks Dan!

But yesterday I sent another patch which incidentally fixes
this too:
https://lore.kernel.org/linux-wireless/20210803232746.3389570-1-linus.walleij@linaro.org/T/#u

As you can see in the last hunk of that patch ret is now
unconditionally assigned on both forks of the
if/else-clause.

Yours,
Linus Walleij

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

end of thread, other threads:[~2021-08-04  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04  8:23 [PATCH] brcmfmac: uninitialized variable in brcmf_fw_get_firmwares() Dan Carpenter
2021-08-04  9:39 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.