Przeglądaj źródła

iwlagn: avoid crash if vif is not assigned

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>
Johannes Berg 14 lat temu
rodzic
commit
893654de3f
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      drivers/net/wireless/iwlwifi/iwl-agn-rxon.c

+ 5 - 0
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c

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