Skip to contentSkip to conversation

wifi: rtlwifi: rtl8821ae: phy: restore removed code to fix infinite loop

PATCH In review Colin Ian King 4 participants 5 messages Nov 6, 2024 – Nov 18, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: rtlwifi: rtl8821ae: phy: restore removed code to fix infinite loop

A previous clean-up fix removed the assignment of v2 inside a while loop that turned it into an infinite loop. Fix this by restoring the assignment of v2 from array[] so that v2 is updated inside the loop.

Fixes cda37445718d ("wifi: rtlwifi: rtl8821ae: phy: remove some useless code")
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c +3 -1
index 1be51ea3f3c8..0d4d787e8be5 100644
@@ -2033,8 +2033,10 @@ static bool _rtl8821ae_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
 			if (!_rtl8821ae_check_condition(hw, v1)) {
 				i += 2; /* skip the pair of expression*/
 				v2 = array[i+1];
-				while (v2 != 0xDEAD)
+				while (v2 != 0xDEAD) {
 					i += 3;
+					v2 = array[i + 1];
+				}
 			}
 		}
 	}
Signature · 1 line
2.39.5
#1 lore raw
FYI: kernel test robot notices the stable kernel rule is not satisfied.

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1

Rule: add the tag "Cc: [email protected]" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH] wifi: rtlwifi: rtl8821ae: phy: restore removed code to fix infinite loop

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer Tested-by on v1 1/1
#2 lore raw
In reply to Colin Ian King
Quoted 6 lines · Colin Ian King

A previous clean-up fix removed the assignment of v2 inside a while loop that turned it into an infinite loop. Fix this by restoring the assignment of v2 from array[] so that v2 is updated inside the loop.

Fixes cda37445718d ("wifi: rtlwifi: rtl8821ae: phy: remove some useless code")

I tested RTL8812AE/8821AE. Luckily, parsing current PHY register parameters never falls into the check condition.

Quoted 23 lines
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c +3 -2
index 1be51ea3f3c8..0d4d787e8be5 100644
@@ -2033,8 +2033,10 @@ static bool _rtl8821ae_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
                        if (!_rtl8821ae_check_condition(hw, v1)) {
                                i += 2; /* skip the pair of expression*/
                                v2 = array[i+1];
-                               while (v2 != 0xDEAD)
+                               while (v2 != 0xDEAD) {
                                        i += 3;
+                                       v2 = array[i + 1];
+                               }
                        }
                }
        }
--

2.39.5

Reviewed-by
#3 lore raw
Quoted 7 lines · Ping-Ke Shih
Quoted 6 lines · Colin Ian King

A previous clean-up fix removed the assignment of v2 inside a while loop that turned it into an infinite loop. Fix this by restoring the assignment of v2 from array[] so that v2 is updated inside the loop.

Fixes cda37445718d ("wifi: rtlwifi: rtl8821ae: phy: remove some useless code")

Thanks for your correction. I'm sorry for this stupid mistake.

Quoted 27 lines

I tested RTL8812AE/8821AE. Luckily, parsing current PHY register parameters never falls into the check condition.

Quoted 23 lines
---
  drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c +3 -2
index 1be51ea3f3c8..0d4d787e8be5 100644
@@ -2033,8 +2033,10 @@ static bool _rtl8821ae_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
                         if (!_rtl8821ae_check_condition(hw, v1)) {
                                 i += 2; /* skip the pair of expression*/
                                 v2 = array[i+1];
-                               while (v2 != 0xDEAD)
+                               while (v2 != 0xDEAD) {
                                         i += 3;
+                                       v2 = array[i + 1];
+                               }
                         }
                 }
         }
--

2.39.5

maintainer
#4 lore raw
In reply to Colin Ian King
Quoted 8 lines · Colin Ian King

A previous clean-up fix removed the assignment of v2 inside a while loop that turned it into an infinite loop. Fix this by restoring the assignment of v2 from array[] so that v2 is updated inside the loop.

Fixes cda37445718d ("wifi: rtlwifi: rtl8821ae: phy: remove some useless code")

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

5e5903a442bb wifi: rtlwifi: rtl8821ae: phy: restore removed code to fix infinite loop

---
https://github.com/pkshih/rtw.git