linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k_hw: fix uninitialized variable data
@ 2019-09-26 22:56 Denis Efremov
  2019-10-01 11:19 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Efremov @ 2019-09-26 22:56 UTC (permalink / raw)
  Cc: Denis Efremov, ath9k-devel, linux-wireless, netdev, linux-kernel,
	Rajkumar Manoharan, John W . Linville, Kalle Valo,
	David S. Miller, stable

Currently, data variable in ar9003_hw_thermo_cal_apply() could be
uninitialized if ar9300_otp_read_word() will fail to read the value.
Initialize data variable with 0 to prevent an undefined behavior. This
will be enough to handle error case when ar9300_otp_read_word() fails.

Fixes: 80fe43f2bbd5 ("ath9k_hw: Read and configure thermocal for AR9462")
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: stable@vger.kernel.org
Signed-off-by: Denis Efremov <efremov@linux.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 2b29bf4730f6..b4885a700296 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -4183,7 +4183,7 @@ static void ar9003_hw_thermometer_apply(struct ath_hw *ah)
 
 static void ar9003_hw_thermo_cal_apply(struct ath_hw *ah)
 {
-	u32 data, ko, kg;
+	u32 data = 0, ko, kg;
 
 	if (!AR_SREV_9462_20_OR_LATER(ah))
 		return;
-- 
2.21.0


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

* Re: [PATCH] ath9k_hw: fix uninitialized variable data
  2019-09-26 22:56 [PATCH] ath9k_hw: fix uninitialized variable data Denis Efremov
@ 2019-10-01 11:19 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2019-10-01 11:19 UTC (permalink / raw)
  To: Denis Efremov

Denis Efremov <efremov@linux.com> wrote:

> Currently, data variable in ar9003_hw_thermo_cal_apply() could be
> uninitialized if ar9300_otp_read_word() will fail to read the value.
> Initialize data variable with 0 to prevent an undefined behavior. This
> will be enough to handle error case when ar9300_otp_read_word() fails.
> 
> Fixes: 80fe43f2bbd5 ("ath9k_hw: Read and configure thermocal for AR9462")
> Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
> Cc: John W. Linville <linville@tuxdriver.com>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: stable@vger.kernel.org
> Signed-off-by: Denis Efremov <efremov@linux.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

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

80e84f36412e ath9k_hw: fix uninitialized variable data

-- 
https://patchwork.kernel.org/patch/11163437/

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


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

end of thread, other threads:[~2019-10-01 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26 22:56 [PATCH] ath9k_hw: fix uninitialized variable data Denis Efremov
2019-10-01 11:19 ` 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).