summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-03-29 10:05:11 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-03-30 13:08:37 +0300
commit42564a74507c450a0edc93f4f06b5537967283fe (patch)
treec8a2cf0fa252eac2ab0fd50ee638106572b22cb0 /drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
parentb7e39d565fe1d32c6d8253340d577cc53fad03d8 (diff)
downloadlinux-42564a74507c450a0edc93f4f06b5537967283fe.tar.xz
wifi: iwlwifi: mvm: rs-fw: don't crash on missing channel
This is more of a workaround, with MLO we can get here with the deflink not assigned. It's not critical right now that we have this right, so WARN_ON_ONCE() and don't crash until we can fix this area of the code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230329100039.2b0d31bdb60b.I39d23c76eec16ac49f6ae3a6d5f7652041bde855@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
index 778c9237fe87..ed4200d9bd04 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
@@ -506,6 +506,9 @@ u16 rs_fw_get_max_amsdu_len(struct ieee80211_sta *sta)
const struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap;
const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap;
+ if (WARN_ON_ONCE(!mvmsta->vif->bss_conf.chandef.chan))
+ return IEEE80211_MAX_MPDU_LEN_VHT_3895;
+
if (mvmsta->vif->bss_conf.chandef.chan->band == NL80211_BAND_6GHZ) {
switch (le16_get_bits(sta->deflink.he_6ghz_capa.capa,
IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN)) {