Search Linux Wireless

[PATCH v2 12/18] iwlwifi: scan: don't pass large argument by value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ayala Beker <ayala.beker@xxxxxxxxx>

Function iwl_mvm_scan_set_legacy_probe_req() second argument
size is too large to be passed by value.
Fix it to be passed by reference.

Signed-off-by: Ayala Beker <ayala.beker@xxxxxxxxx>
Signed-off-by: Luca Coelho <luciano.coelho@xxxxxxxxx>
---
 drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index 85e33310804e..afa44345f37b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -961,15 +961,15 @@ static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm,
 
 static void
 iwl_mvm_scan_set_legacy_probe_req(struct iwl_scan_probe_req_v1 *p_req,
-				  struct iwl_scan_probe_req src_p_req)
+				  struct iwl_scan_probe_req *src_p_req)
 {
 	int i;
 
-	p_req->mac_header = src_p_req.mac_header;
+	p_req->mac_header = src_p_req->mac_header;
 	for (i = 0; i < SCAN_NUM_BAND_PROBE_DATA_V_1; i++)
-		p_req->band_data[i] = src_p_req.band_data[i];
-	p_req->common_data = src_p_req.common_data;
-	memcpy(p_req->buf, src_p_req.buf, SCAN_OFFLOAD_PROBE_REQ_SIZE);
+		p_req->band_data[i] = src_p_req->band_data[i];
+	p_req->common_data = src_p_req->common_data;
+	memcpy(p_req->buf, src_p_req->buf, sizeof(p_req->buf));
 }
 
 static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
@@ -1046,7 +1046,7 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	iwl_mvm_lmac_scan_cfg_channels(mvm, params->channels,
 				       params->n_channels, ssid_bitmap, cmd);
 
-	iwl_mvm_scan_set_legacy_probe_req(preq, params->preq);
+	iwl_mvm_scan_set_legacy_probe_req(preq, &params->preq);
 
 	return 0;
 }
@@ -1592,7 +1592,8 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 		direct_scan = tail_v2->direct_scan;
 	} else {
 		tail_v1 = (struct iwl_scan_req_umac_tail_v1 *)sec_part;
-		iwl_mvm_scan_set_legacy_probe_req(&tail_v1->preq, params->preq);
+		iwl_mvm_scan_set_legacy_probe_req(&tail_v1->preq,
+						  &params->preq);
 		direct_scan = tail_v1->direct_scan;
 	}
 	iwl_scan_build_ssids(params, direct_scan, &ssid_bitmap);
-- 
2.23.0.rc1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux