From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Daniel Gabay <daniel.gabay@intel.com>,
Ilan Peer <ilan.peer@intel.com>,
Miri Korenblit <miriam.rachel.korenblit@intel.com>,
Johannes Berg <johannes.berg@intel.com>,
Sasha Levin <sashal@kernel.org>,
kvalo@kernel.org, ayala.beker@intel.com, benjamin.berg@intel.com,
linux-wireless@vger.kernel.org
Subject: [PATCH AUTOSEL 5.15 09/12] wifi: iwlwifi: mvm: fix iwl_mvm_scan_fits() calculation
Date: Tue, 3 Sep 2024 15:26:53 -0400 [thread overview]
Message-ID: <20240903192718.1108456-9-sashal@kernel.org> (raw)
In-Reply-To: <20240903192718.1108456-1-sashal@kernel.org>
From: Daniel Gabay <daniel.gabay@intel.com>
[ Upstream commit d44162280899c3fc2c6700e21e491e71c3c96e3d ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 23 ++++++++++---------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index 8179a7395bcaf..d6e25f7e700ef 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -834,8 +834,8 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids,
return ((n_ssids <= PROBE_OPTION_MAX) &&
(n_channels <= mvm->fw->ucode_capa.n_scan_channels) &
(ies->common_ie_len +
- ies->len[NL80211_BAND_2GHZ] +
- ies->len[NL80211_BAND_5GHZ] <=
+ ies->len[NL80211_BAND_2GHZ] + ies->len[NL80211_BAND_5GHZ] +
+ ies->len[NL80211_BAND_6GHZ] <=
iwl_mvm_max_scan_ie_fw_cmd_room(mvm)));
}
@@ -2775,18 +2775,16 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
params.n_channels = j;
}
- if (non_psc_included &&
- !iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) {
- kfree(params.channels);
- return -ENOBUFS;
+ if (!iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) {
+ ret = -ENOBUFS;
+ goto out;
}
uid = iwl_mvm_build_scan_cmd(mvm, vif, &hcmd, ¶ms, type);
-
- if (non_psc_included)
- kfree(params.channels);
- if (uid < 0)
- return uid;
+ if (uid < 0) {
+ ret = uid;
+ goto out;
+ }
ret = iwl_mvm_send_cmd(mvm, &hcmd);
if (!ret) {
@@ -2803,6 +2801,9 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
}
+out:
+ if (non_psc_included)
+ kfree(params.channels);
return ret;
}
--
2.43.0
next prev parent reply other threads:[~2024-09-03 20:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 19:26 [PATCH AUTOSEL 5.15 01/12] ASoC: allow module autoloading for table db1200_pids Sasha Levin
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 02/12] ALSA: hda/realtek - Fixed ALC256 headphone no sound Sasha Levin
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 03/12] ALSA: hda/realtek - FIxed ALC285 " Sasha Levin
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 04/12] scsi: lpfc: Fix overflow build issue Sasha Levin
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 05/12] pinctrl: at91: make it work with current gpiolib Sasha Levin
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 06/12] microblaze: don't treat zero reserved memory regions as error Sasha Levin
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 07/12] net: ftgmac100: Ensure tx descriptor updates are visible Sasha Levin
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 08/12] wifi: iwlwifi: lower message level for FW buffer destination Sasha Levin
2024-09-03 19:26 ` Sasha Levin [this message]
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 10/12] wifi: iwlwifi: mvm: pause TCM when the firmware is stopped Sasha Levin
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 11/12] wifi: iwlwifi: mvm: don't wait for tx queues if firmware is dead Sasha Levin
2024-09-03 19:26 ` [PATCH AUTOSEL 5.15 12/12] wifi: iwlwifi: clear trans->state earlier upon error Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240903192718.1108456-9-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=ayala.beker@intel.com \
--cc=benjamin.berg@intel.com \
--cc=daniel.gabay@intel.com \
--cc=ilan.peer@intel.com \
--cc=johannes.berg@intel.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=miriam.rachel.korenblit@intel.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox