linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <egrumbach@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: David Spinadel <david.spinadel@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 02/27] iwlwifi: mvm: use ksize to memset scan_command
Date: Tue, 24 Jun 2014 22:51:56 +0300	[thread overview]
Message-ID: <1403639541-4621-2-git-send-email-egrumbach@gmail.com> (raw)
In-Reply-To: <53A9D6CF.9040100@gmail.com>

From: David Spinadel <david.spinadel@intel.com>

Use ksize to get scan command size instead of calculating it, to
avoid nasty bugs.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/scan.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 4b6c7d4..df8f3eb 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -325,9 +325,7 @@ int iwl_mvm_scan_request(struct iwl_mvm *mvm,
 
 	IWL_DEBUG_SCAN(mvm, "Handling mac80211 scan request\n");
 	mvm->scan_status = IWL_MVM_SCAN_OS;
-	memset(cmd, 0, sizeof(struct iwl_scan_cmd) +
-	       mvm->fw->ucode_capa.max_probe_length +
-	       (MAX_NUM_SCAN_CHANNELS * sizeof(struct iwl_scan_channel)));
+	memset(cmd, 0, ksize(cmd));
 
 	cmd->channel_count = (u8)req->n_channels;
 	cmd->quiet_time = cpu_to_le16(IWL_ACTIVE_QUIET_TIME);
-- 
1.8.3.2


  parent reply	other threads:[~2014-06-24 19:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 19:51 pull request: iwlwifi-next 2014-06-24 Emmanuel Grumbach
2014-06-24 19:51 ` [PATCH 01/27] iwlwifi: bump API version for 8000 devices Emmanuel Grumbach
2014-06-24 19:51 ` Emmanuel Grumbach [this message]
2014-06-24 19:51 ` [PATCH 03/27] iwlwifi: mvm: add back support for low-priority scan Emmanuel Grumbach
2014-06-24 19:51 ` [PATCH 04/27] iwlwifi: mvm: don't use hardcoded num of scan channels Emmanuel Grumbach
2014-06-24 19:51 ` [PATCH 05/27] iwlwifi: remove MCS32 support declaration Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 06/27] iwlwifi: add device / firmware to fw-error-dump file Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 07/27] iwlwifi: rename iwl_mvm_fw_error_next_data Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 08/27] iwlwifi: pcie: add firmware monitor capabilities Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 09/27] iwlwifi: mvm: fixes for 8000 NVM flow Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 10/27] iwlwifi: fix NVM channel attribute map Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 11/27] iwlwifi: pcie: log when waking the NIC for hcmd submission fails Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 12/27] iwlwifi: pcie: improve debugfs queue info Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 13/27] iwlwifi: dvm: add a force_cam module parameter to fully disable power saving Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 14/27] iwlwifi: mvm: fix bug in set_hw_address function Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 15/27] iwlwifi: update trans->hw_rev 8000 hw family format Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 16/27] iwlwifi: nvm: update maximal parsed values in external nvm Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 17/27] iwlwifi: mvm: assure no overflows occur while reading otp Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 18/27] iwlwifi: mvm: BT Coex - allow to force the antenna allocation Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 19/27] iwlwifi: mvm: BT Coex - allow MIMO in more cases Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 20/27] iwlwifi: mvm: BT Coex - don't limit rate control if TTC is on Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 21/27] iwlwifi: mvm: BT Coex - add reduced Tx power thresholds to constants Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 22/27] iwlwifi: mvm: BT Coex - avoid the shared antenna for management frames Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 23/27] iwlwifi: mvm: disable beacon filtering escape timer in d0i3 Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 24/27] iwlwifi: mvm: Introduce an API to set STA_FLG_DISABLE_TX flag Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 25/27] iwlwifi: mvm: support extended beacon notification Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 26/27] iwlwivi: mvm: BT Coex - properly set the priority of beacons Emmanuel Grumbach
2014-06-24 19:52 ` [PATCH 27/27] iwlwifi: mvm: handle device start failures during restart Emmanuel Grumbach
2014-06-24 19:53 ` pull request: iwlwifi-next 2014-06-24 Emmanuel Grumbach
2014-06-25 19:29 ` John W. Linville

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=1403639541-4621-2-git-send-email-egrumbach@gmail.com \
    --to=egrumbach@gmail.com \
    --cc=david.spinadel@intel.com \
    --cc=emmanuel.grumbach@intel.com \
    --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).