aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index 93067686218..1b112dfbce7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -647,7 +647,7 @@ void iwl_reprogram_ap_sta(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
647 int ret; 647 int ret;
648 struct iwl_addsta_cmd sta_cmd; 648 struct iwl_addsta_cmd sta_cmd;
649 struct iwl_link_quality_cmd lq; 649 struct iwl_link_quality_cmd lq;
650 bool active; 650 bool active, have_lq = false;
651 651
652 spin_lock_irqsave(&priv->shrd->sta_lock, flags); 652 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
653 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) { 653 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) {
@@ -657,7 +657,10 @@ void iwl_reprogram_ap_sta(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
657 657
658 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(sta_cmd)); 658 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(sta_cmd));
659 sta_cmd.mode = 0; 659 sta_cmd.mode = 0;
660 memcpy(&lq, priv->stations[sta_id].lq, sizeof(lq)); 660 if (priv->stations[sta_id].lq) {
661 memcpy(&lq, priv->stations[sta_id].lq, sizeof(lq));
662 have_lq = true;
663 }
661 664
662 active = priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE; 665 active = priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE;
663 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE; 666 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE;
@@ -679,7 +682,8 @@ void iwl_reprogram_ap_sta(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
679 if (ret) 682 if (ret)
680 IWL_ERR(priv, "failed to re-add STA %pM (%d)\n", 683 IWL_ERR(priv, "failed to re-add STA %pM (%d)\n",
681 priv->stations[sta_id].sta.sta.addr, ret); 684 priv->stations[sta_id].sta.sta.addr, ret);
682 iwl_send_lq_cmd(priv, ctx, &lq, CMD_SYNC, true); 685 if (have_lq)
686 iwl_send_lq_cmd(priv, ctx, &lq, CMD_SYNC, true);
683} 687}
684 688
685int iwl_get_free_ucode_key_offset(struct iwl_priv *priv) 689int iwl_get_free_ucode_key_offset(struct iwl_priv *priv)