wifi: iwlwifi: mvm: initialize the rx_vec before using it
authorMukesh Sisodiya <mukesh.sisodiya@intel.com>
Tue, 13 Jun 2023 12:57:16 +0000 (15:57 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 14 Jun 2023 10:32:19 +0000 (12:32 +0200)
Initialize the phy_data.rx_vec for both version-3 and above
where it is 4-byte data size and below version which has
data size of 2-byte.
The data will be sent uninitialized in called function if
notification version is less than three.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230613155501.a6bb856f04bc.I9a15075f3dad61dcabdcd1ed0d34cf3e8ec5453f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

index 70db4fef6290b6ea82dacc7cd6d54ba9c183b0b5..9d8d9def9391be50aaea16ccb2e796402dda6754 100644 (file)
@@ -2642,6 +2642,8 @@ void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi,
        phy_data.energy_b = u32_get_bits(rssi, RX_NO_DATA_CHAIN_B_MSK);
        phy_data.channel = u32_get_bits(rssi, RX_NO_DATA_CHANNEL_MSK);
        phy_data.with_data = false;
+       phy_data.rx_vec[0] = desc->rx_vec[0];
+       phy_data.rx_vec[1] = desc->rx_vec[1];
 
        if (iwl_fw_lookup_notif_ver(mvm->fw, DATA_PATH_GROUP,
                                    RX_NO_DATA_NOTIF, 0) < 2) {
@@ -2660,7 +2662,8 @@ void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi,
                    sizeof(struct iwl_rx_no_data_ver_3)))
                /* invalid len for ver 3 */
                        return;
-               memcpy(phy_data.rx_vec, desc->rx_vec, sizeof(phy_data.rx_vec));
+               phy_data.rx_vec[2] = desc->rx_vec[2];
+               phy_data.rx_vec[3] = desc->rx_vec[3];
        } else {
                if (format == RATE_MCS_EHT_MSK)
                        /* no support for EHT before version 3 API */