From: Shanyu Zhao Date: Thu, 2 Dec 2010 19:02:28 +0000 (-0800) Subject: iwlagn: check ready in iwlagn_bss_info_changed() X-Git-Tag: upstream/snapshot3+hdmi~12141^2~14^2~3^2~125^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae0b693c12cc78913085733d28e0e0e6020db6f4;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git iwlagn: check ready in iwlagn_bss_info_changed() 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 Signed-off-by: Wey-Yi Guy --- diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c index 4865b82..769479e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c @@ -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; }