aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gabay <[email protected]>2024-12-26 15:44:54 +0000
committerJohannes Berg <[email protected]>2025-01-13 13:00:55 +0000
commit1532c5d67d97cacbe83dd9b7f74b8844ee42b2e6 (patch)
treede25afddc97789a15c68f71bef894df754841174
parentwifi: iwlwifi: pcie: Add support for new device ids (diff)
downloadkernel-1532c5d67d97cacbe83dd9b7f74b8844ee42b2e6.tar.gz
kernel-1532c5d67d97cacbe83dd9b7f74b8844ee42b2e6.zip
wifi: iwlwifi: mvm: Use IWL_FW_CHECK() for BAR notif size validation
Use IWL_FW_CHECK() for BAR notification size validation, improving diagnostics with a clear error message on failure. Signed-off-by: Daniel Gabay <[email protected]> Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20241226174257.913d5d476929.I8cd62f45bacc088c309b0152fc392dc2579e82e0@changeid Signed-off-by: Johannes Berg <[email protected]>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index e8ea48936c2d..c03cb7cc2f1c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -2507,9 +2507,12 @@ void iwl_mvm_rx_bar_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,
struct iwl_rx_packet *pkt = rxb_addr(rxb);
struct iwl_bar_frame_release *release = (void *)pkt->data;
struct iwl_mvm_baid_data *baid_data;
+ u32 pkt_len = iwl_rx_packet_payload_len(pkt);
unsigned int baid, nssn, sta_id, tid;
- if (unlikely(iwl_rx_packet_payload_len(pkt) < sizeof(*release)))
+ if (IWL_FW_CHECK(mvm, pkt_len < sizeof(*release),
+ "Unexpected frame release notif size %d (expected %zu)\n",
+ pkt_len, sizeof(*release)))
return;
baid = le32_get_bits(release->ba_info,