浏览代码

iwlwifi: mvm: fix off-by-one in scan channels configuration

tail should be equal to the last valid index, so
decrease it by one.

This error causes in "a gap" in some cases (as well as
some possible out-of-bound write), finally resulting in
ucode assertion.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Eliad Peller 11 年之前
父节点
当前提交
64793110ad
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/net/wireless/iwlwifi/mvm/scan.c

+ 1 - 1
drivers/net/wireless/iwlwifi/mvm/scan.c

@@ -732,7 +732,7 @@ int iwl_mvm_config_sched_scan(struct iwl_mvm *mvm,
 	int band_2ghz = mvm->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels;
 	int band_2ghz = mvm->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels;
 	int band_5ghz = mvm->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels;
 	int band_5ghz = mvm->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels;
 	int head = 0;
 	int head = 0;
-	int tail = band_2ghz + band_5ghz;
+	int tail = band_2ghz + band_5ghz - 1;
 	u32 ssid_bitmap;
 	u32 ssid_bitmap;
 	int cmd_len;
 	int cmd_len;
 	int ret;
 	int ret;