* [PATCH] rtlwifi: rtl892cu: Set limit for pwdb_all
@ 2025-04-02 7:10 Wentao Liang
2025-04-02 9:02 ` Ping-Ke Shih
0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2025-04-02 7:10 UTC (permalink / raw)
To: pkshih, kvalo; +Cc: linux-wireless, linux-kernel, Wentao Liang, stable
In _rtl92c_query_rxphystatus(), the return rtl_query_rxpwrpercentage()
need to be checked. A proper implementation can be found in
_rtl8723be_query_rxphystatus(). Add a value check and set the limit of
pwdb_add as 100.
Fixes: 666e8457fae4 ("rtlwifi: rtl8192cu: Add routine mac")
Cc: stable@vger.kernel.org # v2.6+
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
index a76f2dc8a977..e2145f284ec0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
@@ -641,6 +641,9 @@ static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw,
}
}
pwdb_all = rtl_query_rxpwrpercentage(rx_pwr_all);
+ if (pwdb_all > 100)
+ pwdb_all = 100;
+
pstats->rx_pwdb_all = pwdb_all;
pstats->recvsignalpower = rx_pwr_all;
if (packet_match_bssid) {
--
2.42.0.windows.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] rtlwifi: rtl892cu: Set limit for pwdb_all
2025-04-02 7:10 [PATCH] rtlwifi: rtl892cu: Set limit for pwdb_all Wentao Liang
@ 2025-04-02 9:02 ` Ping-Ke Shih
0 siblings, 0 replies; 2+ messages in thread
From: Ping-Ke Shih @ 2025-04-02 9:02 UTC (permalink / raw)
To: Wentao Liang, kvalo@kernel.org
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Wentao Liang <vulab@iscas.ac.cn> wrote:
>
> In _rtl92c_query_rxphystatus(), the return rtl_query_rxpwrpercentage()
> need to be checked. A proper implementation can be found in
> _rtl8723be_query_rxphystatus(). Add a value check and set the limit of
> pwdb_add as 100.
Have you tested on real hardware? Or just guess this is a potential problem?
If that is a real problem, please point out what it happens in commit message.
By the way, subject should be "wifi: rtlwifi: ..."
>
> Fixes: 666e8457fae4 ("rtlwifi: rtl8192cu: Add routine mac")
> Cc: stable@vger.kernel.org # v2.6+
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
> index a76f2dc8a977..e2145f284ec0 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
> @@ -641,6 +641,9 @@ static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw,
> }
> }
> pwdb_all = rtl_query_rxpwrpercentage(rx_pwr_all);
> + if (pwdb_all > 100)
> + pwdb_all = 100;
> +
> pstats->rx_pwdb_all = pwdb_all;
> pstats->recvsignalpower = rx_pwr_all;
> if (packet_match_bssid) {
> --
> 2.42.0.windows.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-02 9:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-02 7:10 [PATCH] rtlwifi: rtl892cu: Set limit for pwdb_all Wentao Liang
2025-04-02 9:02 ` Ping-Ke Shih
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.