]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/net/wireless/intel/iwlwifi/mvm/sta.c
iwlwifi: don't throw error when trying to remove IGTK
[mirror_ubuntu-bionic-kernel.git] / drivers / net / wireless / intel / iwlwifi / mvm / sta.c
index 02acb7c56535582f1bfa9dddf36fda77c83d0963..c25f9eaf7e9dd00bf387bb1207265bc101c98fab 100644 (file)
@@ -3018,6 +3018,10 @@ static int iwl_mvm_send_sta_igtk(struct iwl_mvm *mvm,
        igtk_cmd.sta_id = cpu_to_le32(sta_id);
 
        if (remove_key) {
+               /* This is a valid situation for IGTK */
+               if (sta_id == IWL_MVM_INVALID_STA)
+                       return 0;
+
                igtk_cmd.ctrl_flags |= cpu_to_le32(STA_KEY_NOT_VALID);
        } else {
                struct ieee80211_key_seq seq;
@@ -3322,9 +3326,9 @@ int iwl_mvm_remove_sta_key(struct iwl_mvm *mvm,
        IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n",
                      keyconf->keyidx, sta_id);
 
-       if (mvm_sta && (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
-                       keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
-                       keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256))
+       if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
+           keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
+           keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)
                return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true);
 
        if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) {