linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 12/18] iwlwifi: scan: don't pass large argument by value
Date: Wed, 21 Aug 2019 16:37:54 +0300	[thread overview]
Message-ID: <20190821133800.23636-13-luca@coelho.fi> (raw)
In-Reply-To: <20190821133800.23636-1-luca@coelho.fi>

From: Ayala Beker <ayala.beker@intel.com>

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@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 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


  parent reply	other threads:[~2019-08-21 13:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21 13:37 [PATCH 00/18] iwlwifi: updates intended for v5.4 2019-08-21 Luca Coelho
2019-08-21 13:37 ` [PATCH 01/18] iwlwifi: mvm: ftm: make common calib signed Luca Coelho
2019-09-03 11:23   ` Kalle Valo
2019-08-21 13:37 ` [PATCH 02/18] iwlwifi: scan: add support for new scan request command version Luca Coelho
2019-08-21 13:37 ` [PATCH 03/18] iwlwifi: mvm: name magic numbers with enum Luca Coelho
2019-08-21 13:37 ` [PATCH 04/18] iwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL Luca Coelho
2019-08-21 13:37 ` [PATCH 05/18] iwlwifi: Set w-pointer upon resume according to SN Luca Coelho
2019-09-03 11:26   ` Kalle Valo
2019-09-05 12:56     ` Luca Coelho
2019-09-05 12:58       ` Kalle Valo
2019-08-21 13:37 ` [PATCH 06/18] iwlwifi: remove runtime_pm_mode Luca Coelho
2019-08-21 13:37 ` [PATCH 07/18] iwlwifi: remove the opmode's d0i3 handlers Luca Coelho
2019-08-21 13:37 ` [PATCH 08/18] iwlwifi: pcie: remove the refs / unrefs from the transport Luca Coelho
2019-08-21 13:37 ` [PATCH 09/18] iwlwifi: pcie: remove some more d0i3 code " Luca Coelho
2019-08-21 13:37 ` [PATCH 10/18] iwlwifi: remove the d0i3 related module parameters Luca Coelho
2019-08-21 13:37 ` [PATCH 11/18] iwlwifi: remove pm_runtime completely Luca Coelho
2019-08-21 13:37 ` Luca Coelho [this message]
2019-08-21 13:37 ` [PATCH 13/18] iwlwifi: dbg_ini: align dbg tlv functions names to a single format Luca Coelho
2019-08-21 13:37 ` [PATCH 14/18] iwlwifi: remove unused regdb_ptrs allocation Luca Coelho
2019-08-21 13:37 ` [PATCH 15/18] iwlwifi: dbg: add debug periphery registers to 9000 device family Luca Coelho
2019-08-21 13:37 ` [PATCH 16/18] iwlwifi: dbg_ini: maintain buffer allocations from trans instead of TLVs buffer Luca Coelho
2019-08-21 13:37 ` [PATCH 17/18] iwlwifi: dbg_ini: use linked list to store debug TLVs Luca Coelho
2019-08-21 13:38 ` [PATCH 18/18] iwlwifi: dbg_ini: remove periphery phy and aux regions handling Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190821133800.23636-13-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).