summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Efremov <efremov@linux.com>2019-09-27 01:56:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-28 18:29:02 +0100
commit8ae0f1781b56af4d40fca9ecc29fde571e123be7 (patch)
treebd27109992f9e93a4da9bc012898da56d01a5a7b
parente528acd31a13f4115ab5a0bf804fd2356a8d3c32 (diff)
downloadlinux-stable-8ae0f1781b56af4d40fca9ecc29fde571e123be7.tar.gz
linux-stable-8ae0f1781b56af4d40fca9ecc29fde571e123be7.tar.bz2
linux-stable-8ae0f1781b56af4d40fca9ecc29fde571e123be7.zip
ath9k_hw: fix uninitialized variable data
commit 80e84f36412e0c5172447b6947068dca0d04ee82 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 08607d7fdb56..7eff6f8023d8 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -4115,7 +4115,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;