diff options
author | 2021-01-17 13:10:29 +0200 | |
---|---|---|
committer | 2021-02-05 11:52:27 +0200 | |
commit | 1e1a58bec773a6c377fd31625650ed5aaaf6e93f (patch) | |
tree | 5924b8c5ce6adefe8b2453e38c2faa4d779c1d00 /drivers/net/wireless/intel/iwlwifi/mvm/rx.c | |
parent | iwlwifi: mvm: add notification size checks (diff) | |
download | linux-dev-1e1a58bec773a6c377fd31625650ed5aaaf6e93f.tar.xz linux-dev-1e1a58bec773a6c377fd31625650ed5aaaf6e93f.zip |
iwlwifi: mvm: check more notification sizes
Some notifications aren't handled by the general RX handler
code, due to multi-queue. Add size checks for them explicitly.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210117130510.1370c776cb31.Ic536bd1aee5368969fbf65db85b9b9b5dc9c6034@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/rx.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c index 2a57e51f056a..8ef5399ad9be 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c @@ -20,6 +20,10 @@ void iwl_mvm_rx_rx_phy_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) { struct iwl_rx_packet *pkt = rxb_addr(rxb); + unsigned int pkt_len = iwl_rx_packet_payload_len(pkt); + + if (unlikely(pkt_len < sizeof(mvm->last_phy_info))) + return; memcpy(&mvm->last_phy_info, pkt->data, sizeof(mvm->last_phy_info)); mvm->ampdu_ref++; |