Skip to content

Commit

Permalink
iwlagn: check ready in iwlagn_bss_info_changed()
Browse files Browse the repository at this point in the history
In function iwlagn_bss_info_changed(), we need to check if the driver
is ready before doing real work. Also, the previously put WARN() is
removed because the vif is not guaranteed to be valid. uCode restart
routine will clear the vif.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
  • Loading branch information
Shanyu Zhao authored and Wey-Yi Guy committed Dec 13, 2010
1 parent a1da077 commit ae0b693
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,14 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,

mutex_lock(&priv->mutex);

if (WARN_ON(!ctx->vif)) {
if (unlikely(!iwl_is_ready(priv))) {
IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
mutex_unlock(&priv->mutex);
return;
}

if (unlikely(!ctx->vif)) {
IWL_DEBUG_MAC80211(priv, "leave - vif is NULL\n");
mutex_unlock(&priv->mutex);
return;
}
Expand Down

0 comments on commit ae0b693

Please sign in to comment.