[PATCH][next] rtlwifi: rtl8192de: Fix uninitialized variable place

Subsystems: realtek wireless driver (rtlwifi family), the rest

STALE1800d

2 messages, 2 authors, 2021-08-30 · open the first message on its own page

[PATCH][next] rtlwifi: rtl8192de: Fix uninitialized variable place

From: Colin King <hidden>
Date: 2021-08-29 18:05:14

From: Colin Ian King <redacted>

In the case where chnl <= 14 variable place is not initialized and
the function returns an uninitialized value. This fixes an earlier
cleanup where I introduced this bug. My bad.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 369956ae5720 ("rtlwifi: rtl8192de: Remove redundant variable initializations")
Signed-off-by: Colin Ian King <redacted>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index 8ae69d914312..b32fa7a75f17 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -896,7 +896,7 @@ static void _rtl92d_ccxpower_index_check(struct ieee80211_hw *hw,
 
 static u8 _rtl92c_phy_get_rightchnlplace(u8 chnl)
 {
-	u8 place;
+	u8 place = chnl;
 
 	if (chnl > 14) {
 		for (place = 14; place < sizeof(channel5g); place++) {
-- 
2.32.0

RE: [PATCH][next] rtlwifi: rtl8192de: Fix uninitialized variable place

From: Pkshih <pkshih@realtek.com>
Date: 2021-08-30 02:01:13

quoted hunk
-----Original Message-----
From: Colin King [mailto:colin.king@canonical.com]
Sent: Monday, August 30, 2021 2:05 AM
To: Pkshih; Kalle Valo; David S . Miller; Jakub Kicinski; linux-wireless@vger.kernel.org;
netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: [PATCH][next] rtlwifi: rtl8192de: Fix uninitialized variable place

From: Colin Ian King <redacted>

In the case where chnl <= 14 variable place is not initialized and
the function returns an uninitialized value. This fixes an earlier
cleanup where I introduced this bug. My bad.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 369956ae5720 ("rtlwifi: rtl8192de: Remove redundant variable initializations")
Signed-off-by: Colin Ian King <redacted>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index 8ae69d914312..b32fa7a75f17 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -896,7 +896,7 @@ static void _rtl92d_ccxpower_index_check(struct ieee80211_hw *hw,

 static u8 _rtl92c_phy_get_rightchnlplace(u8 chnl)
 {
-	u8 place;
+	u8 place = chnl;

 	if (chnl > 14) {
 		for (place = 14; place < sizeof(channel5g); place++) {
Nathan Chancellor has sent a patch [1] to fix this, and the patch 
has been merged.

[1] https://patchwork.kernel.org/project/linux-wireless/patch/20210823222014.764557-1-nathan@kernel.org/

--
Ping-Ke
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help