iwlagn: avoid crash if vif is not assigned
authorJohannes Berg <johannes.berg@intel.com>
Thu, 11 Nov 2010 02:25:47 +0000 (18:25 -0800)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Tue, 16 Nov 2010 15:46:26 +0000 (07:46 -0800)
For reasons that aren't entirely clear to me,
we sometimes get here during hardware reset
without the interface being set. Don't crash,
but keep a warning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c

index 2d927a94074da155ed24e5c9be03598725567839..fbaa8d293654738c6ebcea4f1aa965172544bf95 100644 (file)
@@ -507,6 +507,11 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
 
        mutex_lock(&priv->mutex);
 
+       if (WARN_ON(!ctx->vif)) {
+               mutex_unlock(&priv->mutex);
+               return;
+       }
+
        if (changes & BSS_CHANGED_BEACON_INT)
                force = true;