]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
iwlwifi: mvm: memset binding before setting values
authorSara Sharon <sara.sharon@intel.com>
Sun, 5 Mar 2017 16:35:02 +0000 (18:35 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 25 Apr 2017 20:06:51 +0000 (23:06 +0300)
The changes in commit 9415af7f306b ("iwlwifi: mvm: support new binding
API") assigned values that were later memset to 0.  Move the memset
earlier.

Fixes: 9415af7f306b ("iwlwifi: mvm: support new binding API")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/binding.c

index 2e0ed080457f8470f3d98fe16c0ab86b5a233f3c..75d35f6b041ef50ed81a020a5d007b9f8746da71 100644 (file)
@@ -86,6 +86,8 @@ static int iwl_mvm_binding_cmd(struct iwl_mvm *mvm, u32 action,
        u32 status;
        int size;
 
+       memset(&cmd, 0, sizeof(cmd));
+
        if (fw_has_capa(&mvm->fw->ucode_capa,
                        IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT)) {
                size = sizeof(cmd);
@@ -98,8 +100,6 @@ static int iwl_mvm_binding_cmd(struct iwl_mvm *mvm, u32 action,
                size = IWL_BINDING_CMD_SIZE_V1;
        }
 
-       memset(&cmd, 0, sizeof(cmd));
-
        cmd.id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(phyctxt->id,
                                                           phyctxt->color));
        cmd.action = cpu_to_le32(action);