summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>2026-03-20 11:09:13 +0300
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>2026-03-25 12:31:57 +0300
commit6e6d8f344dbb00f232e73dbd0813cfabdd35b15f (patch)
tree29424764b667a23aa6bef381ca674380cfc8bcc9
parent454e9141ae96691ad380f7f3f7d11fe652a03cb5 (diff)
downloadlinux-6e6d8f344dbb00f232e73dbd0813cfabdd35b15f.tar.xz
wifi: iwlwifi: validate the channels received in iwl_mcc_update_resp_v*
Check with IWL_FW_CHECK that the FW doesn't send a channel that we don't support. Otherwise, the center frequency will be 0, leading to a warning since is_valid_reg_rule will return false, of course. Although the warning is verbose enough, the IWL_FW_CHECK will spare some of the debug. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20260320100746.0e83cdd88cea.Ic86852e622ed3ec06110f9e6525f72679236cf1e@changeid
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index e5b08c4e7f15..8f3f651451bb 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -23,6 +23,8 @@
#include "fw/api/commands.h"
#include "fw/api/cmdhdr.h"
#include "fw/img.h"
+#include "fw/dbg.h"
+
#include "mei/iwl-mei.h"
/* NVM offsets (in words) definitions */
@@ -1702,6 +1704,11 @@ iwl_parse_nvm_mcc_info(struct iwl_trans *trans,
band);
new_rule = false;
+ if (IWL_FW_CHECK(trans, !center_freq,
+ "Invalid channel %d (idx %d) in NVM\n",
+ nvm_chan[ch_idx], ch_idx))
+ continue;
+
if (!(ch_flags & NVM_CHANNEL_VALID)) {
iwl_nvm_print_channel_flags(dev, IWL_DL_LAR,
nvm_chan[ch_idx], ch_flags);