public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: mwifiex: Fix uninitialized variable in mwifiex_cfg80211_authenticate()
@ 2024-08-15 11:29 Dan Carpenter
  2024-08-15 17:31 ` Brian Norris
  2024-08-22  8:41 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-08-15 11:29 UTC (permalink / raw)
  To: David Lin
  Cc: Brian Norris, Francesco Dolcini, Kalle Valo, Johannes Berg,
	Aloka Dixit, Sascha Hauer, Rafael Beims, Ruan Jinjie,
	linux-wireless, linux-kernel, kernel-janitors

Smatch complains that:

    drivers/net/wireless/marvell/mwifiex/cfg80211.c:4408 mwifiex_cfg80211_authenticate()
    error: uninitialized symbol 'varptr'.

It's a check for NULL, but "varptr" is either non-NULL or uninitialized.
Initialize it to NULL.

Fixes: 36995892c271 ("wifi: mwifiex: add host mlme for client mode")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 722ead51e912..7505de304052 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4284,7 +4284,7 @@ mwifiex_cfg80211_authenticate(struct wiphy *wiphy,
 	struct mwifiex_txinfo *tx_info;
 	u32 tx_control = 0, pkt_type = PKT_TYPE_MGMT;
 	u8 trans = 1, status_code = 0;
-	u8 *varptr;
+	u8 *varptr = NULL;
 
 	if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) {
 		mwifiex_dbg(priv->adapter, ERROR, "Interface role is AP\n");
-- 
2.43.0


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

* Re: [PATCH] wifi: mwifiex: Fix uninitialized variable in mwifiex_cfg80211_authenticate()
  2024-08-15 11:29 [PATCH] wifi: mwifiex: Fix uninitialized variable in mwifiex_cfg80211_authenticate() Dan Carpenter
@ 2024-08-15 17:31 ` Brian Norris
  2024-08-22  8:41 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Norris @ 2024-08-15 17:31 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: David Lin, Francesco Dolcini, Kalle Valo, Johannes Berg,
	Aloka Dixit, Sascha Hauer, Rafael Beims, Ruan Jinjie,
	linux-wireless, linux-kernel, kernel-janitors

On Thu, Aug 15, 2024 at 02:29:27PM +0300, Dan Carpenter wrote:
> Smatch complains that:
> 
>     drivers/net/wireless/marvell/mwifiex/cfg80211.c:4408 mwifiex_cfg80211_authenticate()
>     error: uninitialized symbol 'varptr'.
> 
> It's a check for NULL, but "varptr" is either non-NULL or uninitialized.
> Initialize it to NULL.
> 
> Fixes: 36995892c271 ("wifi: mwifiex: add host mlme for client mode")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Acked-by: Brian Norris <briannorris@chromium.org>

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

* Re: [PATCH] wifi: mwifiex: Fix uninitialized variable in mwifiex_cfg80211_authenticate()
  2024-08-15 11:29 [PATCH] wifi: mwifiex: Fix uninitialized variable in mwifiex_cfg80211_authenticate() Dan Carpenter
  2024-08-15 17:31 ` Brian Norris
@ 2024-08-22  8:41 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2024-08-22  8:41 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: David Lin, Brian Norris, Francesco Dolcini, Johannes Berg,
	Aloka Dixit, Sascha Hauer, Rafael Beims, Ruan Jinjie,
	linux-wireless, linux-kernel, kernel-janitors

Dan Carpenter <dan.carpenter@linaro.org> wrote:

> Smatch complains that:
> 
>     drivers/net/wireless/marvell/mwifiex/cfg80211.c:4408 mwifiex_cfg80211_authenticate()
>     error: uninitialized symbol 'varptr'.
> 
> It's a check for NULL, but "varptr" is either non-NULL or uninitialized.
> Initialize it to NULL.
> 
> Fixes: 36995892c271 ("wifi: mwifiex: add host mlme for client mode")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> Acked-by: Brian Norris <briannorris@chromium.org>

Patch applied to wireless-next.git, thanks.

c9f4c1ec6972 wifi: mwifiex: Fix uninitialized variable in mwifiex_cfg80211_authenticate()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/d7d043b2-95d5-4e1d-b340-5d7330053ac6@stanley.mountain/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2024-08-22  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 11:29 [PATCH] wifi: mwifiex: Fix uninitialized variable in mwifiex_cfg80211_authenticate() Dan Carpenter
2024-08-15 17:31 ` Brian Norris
2024-08-22  8:41 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox