Skip to content

Commit

Permalink
iwlwifi: mvm: use ksize to memset scan_command
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Spinadel authored and Emmanuel Grumbach committed Jun 24, 2014
1 parent 14ca0f3 commit 0564679
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/wireless/iwlwifi/mvm/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0564679

Please sign in to comment.