···475475 if (!test_and_set_bit(i, &priv->ucode_key_table))476476 return i;477477478478- return -1;478478+ return WEP_INVALID_OFFSET;479479}480480481481int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty)···620620 /* else, we are overriding an existing key => no need to allocated room621621 * in uCode. */622622623623+ WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,624624+ "no space for new kew");625625+623626 priv->stations[sta_id].sta.key.key_flags = key_flags;624627 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;625628 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;···640637{641638 unsigned long flags;642639 __le16 key_flags = 0;640640+ int ret;643641644642 key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK);645643 key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);···668664 /* else, we are overriding an existing key => no need to allocated room669665 * in uCode. */670666667667+ WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,668668+ "no space for new kew");669669+671670 priv->stations[sta_id].sta.key.key_flags = key_flags;672671 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;673672 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;674673674674+ ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);675675+675676 spin_unlock_irqrestore(&priv->sta_lock, flags);676677677677- IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n");678678- return iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);678678+ return ret;679679}680680681681static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,···703695 iwl_get_free_ucode_key_index(priv);704696 /* else, we are overriding an existing key => no need to allocated room705697 * in uCode. */698698+699699+ WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,700700+ "no space for new kew");706701707702 /* This copy is acutally not needed: we get the key with each TX */708703 memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16);···741730 * been replaced by another one with different index.742731 * Don't do anything and return ok743732 */733733+ spin_unlock_irqrestore(&priv->sta_lock, flags);734734+ return 0;735735+ }736736+737737+ if (priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) {738738+ IWL_WARNING("Removing wrong key %d 0x%x\n",739739+ keyconf->keyidx, key_flags);744740 spin_unlock_irqrestore(&priv->sta_lock, flags);745741 return 0;746742 }
···9999100100 sta = rcu_dereference(local->sta_hash[STA_HASH(addr)]);101101 while (sta) {102102- if (compare_ether_addr(sta->sta.addr, addr) == 0)102102+ if (memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)103103 break;104104 sta = rcu_dereference(sta->hnext);105105 }