diff mbox series

[09/12] wifi: iwlwifi: mvm: Reset rate index if rate is wrong

Message ID 20230127002430.8eede67758bb.I585ab389e27d61153540b7cb5ebed66e21f765f0@changeid
State New
Headers show
Series iwlwifi: updates intended for v6.3 2023-01-27 | expand

Commit Message

Greenman, Gregory Jan. 26, 2023, 10:28 p.m. UTC
From: Mukesh Sisodiya <mukesh.sisodiya@intel.com>

Setting rate index should not depend on net_ratelimit().
Fix that for the case of invalid rate.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index 4e7115ebede7..8453c5e13667 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -1730,10 +1730,11 @@  static void iwl_mvm_rx_fill_status(struct iwl_mvm *mvm,
 
 		rx_status->rate_idx = rate;
 
-		if ((rate < 0 || rate > 0xFF) && net_ratelimit()) {
-			IWL_ERR(mvm, "Invalid rate flags 0x%x, band %d,\n",
-				rate_n_flags, rx_status->band);
+		if ((rate < 0 || rate > 0xFF)) {
 			rx_status->rate_idx = 0;
+			if (net_ratelimit())
+				IWL_ERR(mvm, "Invalid rate flags 0x%x, band %d,\n",
+					rate_n_flags, rx_status->band);
 		}
 
 		break;