Skip to content

Commit d441622

Browse files
gabaydjmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: fix iwl_mvm_scan_fits() calculation
The calculation should consider also the 6GHz IE's len, fix that. In addition, in iwl_mvm_sched_scan_start() the scan_fits helper is called only in case non_psc_incldued is true, but it should be called regardless, fix that as well. Signed-off-by: Daniel Gabay <daniel.gabay@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20240825191257.7db825442fd2.I99f4d6587709de02072fd57957ec7472331c6b1d@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent f8a129c commit d441622

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

  • drivers/net/wireless/intel/iwlwifi/mvm

drivers/net/wireless/intel/iwlwifi/mvm/scan.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,8 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids,
837837
return ((n_ssids <= PROBE_OPTION_MAX) &&
838838
(n_channels <= mvm->fw->ucode_capa.n_scan_channels) &
839839
(ies->common_ie_len +
840-
ies->len[NL80211_BAND_2GHZ] +
841-
ies->len[NL80211_BAND_5GHZ] <=
840+
ies->len[NL80211_BAND_2GHZ] + ies->len[NL80211_BAND_5GHZ] +
841+
ies->len[NL80211_BAND_6GHZ] <=
842842
iwl_mvm_max_scan_ie_fw_cmd_room(mvm)));
843843
}
844844

@@ -3168,18 +3168,16 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
31683168
params.n_channels = j;
31693169
}
31703170

3171-
if (non_psc_included &&
3172-
!iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) {
3173-
kfree(params.channels);
3174-
return -ENOBUFS;
3171+
if (!iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) {
3172+
ret = -ENOBUFS;
3173+
goto out;
31753174
}
31763175

31773176
uid = iwl_mvm_build_scan_cmd(mvm, vif, &hcmd, &params, type);
3178-
3179-
if (non_psc_included)
3180-
kfree(params.channels);
3181-
if (uid < 0)
3182-
return uid;
3177+
if (uid < 0) {
3178+
ret = uid;
3179+
goto out;
3180+
}
31833181

31843182
ret = iwl_mvm_send_cmd(mvm, &hcmd);
31853183
if (!ret) {
@@ -3197,6 +3195,9 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
31973195
mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
31983196
}
31993197

3198+
out:
3199+
if (non_psc_included)
3200+
kfree(params.channels);
32003201
return ret;
32013202
}
32023203

0 commit comments

Comments
 (0)