diff options
author | Johannes Berg <johannes.berg@intel.com> | 2021-01-17 14:10:29 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2021-02-05 12:52:27 +0300 |
commit | 1e1a58bec773a6c377fd31625650ed5aaaf6e93f (patch) | |
tree | 5924b8c5ce6adefe8b2453e38c2faa4d779c1d00 /drivers/net/wireless/intel/iwlwifi/mvm/rx.c | |
parent | afc857bc2a71905b23bbe1894dbadb2915a3ac4d (diff) | |
download | linux-1e1a58bec773a6c377fd31625650ed5aaaf6e93f.tar.xz |
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++; |