diff mbox series

wcn36xx: Uninitialized variable in wcn36xx_change_opchannel()

Message ID 20220201125941.GA22458@kili
State New
Headers show
Series wcn36xx: Uninitialized variable in wcn36xx_change_opchannel() | expand

Commit Message

Dan Carpenter Feb. 1, 2022, 12:59 p.m. UTC
This code needs "channel" to be initialized to NULL for it to work
correctly.

Fixes: d6f2746691cb ("wcn36xx: Track the band and channel we are tuned to")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bryan O'Donoghue Feb. 1, 2022, 9:34 p.m. UTC | #1
On 01/02/2022 12:59, Dan Carpenter wrote:
> This code needs "channel" to be initialized to NULL for it to work
> correctly.
> 
> Fixes: d6f2746691cb ("wcn36xx: Track the band and channel we are tuned to")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

good catch

Reviewed-by: Bryan O'Donoghue <bryan.odonghue@linaro.org>
Kalle Valo Feb. 10, 2022, 8:51 a.m. UTC | #2
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> This code needs "channel" to be initialized to NULL for it to work
> correctly.
> 
> Fixes: d6f2746691cb ("wcn36xx: Track the band and channel we are tuned to")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Bryan O'Donoghue <bryan.odonghue@linaro.org>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

11e41e292937 wcn36xx: Uninitialized variable in wcn36xx_change_opchannel()
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 75661d449712..1a06eff07107 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -394,7 +394,7 @@  static void wcn36xx_change_opchannel(struct wcn36xx *wcn, int ch)
 	struct ieee80211_vif *vif = NULL;
 	struct wcn36xx_vif *tmp;
 	struct ieee80211_supported_band *band;
-	struct ieee80211_channel *channel;
+	struct ieee80211_channel *channel = NULL;
 	unsigned long flags;
 	int i, j;