aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2012-04-18 11:01:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-23 14:56:12 -0400
commit8db4c7e25d153fb049e81715d72fa3be3a0c3b69 (patch)
tree9ea2cd4f36d525b5eaee150cce811b71a2d6ffa0 /drivers/net/wireless
parent83722bd4aede80714f75bedc3cce9b6ea9baea7b (diff)
iwlwifi: do not nulify ctx->vif on reset
ctx->vif is dereferenced in different part of iwlwifi code, so do not nullify it. This should address at least one of the possible reasons of WARNING at iwlagn_mac_remove_interface, and perhaps some random crashes when firmware reset is performed. Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f1226dbf789d..2a9a16f901c3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -863,7 +863,6 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
863 863
864void iwlagn_prepare_restart(struct iwl_priv *priv) 864void iwlagn_prepare_restart(struct iwl_priv *priv)
865{ 865{
866 struct iwl_rxon_context *ctx;
867 bool bt_full_concurrent; 866 bool bt_full_concurrent;
868 u8 bt_ci_compliance; 867 u8 bt_ci_compliance;
869 u8 bt_load; 868 u8 bt_load;
@@ -872,8 +871,6 @@ void iwlagn_prepare_restart(struct iwl_priv *priv)
872 871
873 lockdep_assert_held(&priv->mutex); 872 lockdep_assert_held(&priv->mutex);
874 873
875 for_each_context(priv, ctx)
876 ctx->vif = NULL;
877 priv->is_open = 0; 874 priv->is_open = 0;
878 875
879 /* 876 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index b6805f8e9a01..c24a7134a6f9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -1244,6 +1244,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1244 struct iwl_rxon_context *tmp, *ctx = NULL; 1244 struct iwl_rxon_context *tmp, *ctx = NULL;
1245 int err; 1245 int err;
1246 enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif); 1246 enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif);
1247 bool reset = false;
1247 1248
1248 IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n", 1249 IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n",
1249 viftype, vif->addr); 1250 viftype, vif->addr);
@@ -1265,6 +1266,13 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1265 tmp->interface_modes | tmp->exclusive_interface_modes; 1266 tmp->interface_modes | tmp->exclusive_interface_modes;
1266 1267
1267 if (tmp->vif) { 1268 if (tmp->vif) {
1269 /* On reset we need to add the same interface again */
1270 if (tmp->vif == vif) {
1271 reset = true;
1272 ctx = tmp;
1273 break;
1274 }
1275
1268 /* check if this busy context is exclusive */ 1276 /* check if this busy context is exclusive */
1269 if (tmp->exclusive_interface_modes & 1277 if (tmp->exclusive_interface_modes &
1270 BIT(tmp->vif->type)) { 1278 BIT(tmp->vif->type)) {
@@ -1291,7 +1299,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1291 ctx->vif = vif; 1299 ctx->vif = vif;
1292 1300
1293 err = iwl_setup_interface(priv, ctx); 1301 err = iwl_setup_interface(priv, ctx);
1294 if (!err) 1302 if (!err || reset)
1295 goto out; 1303 goto out;
1296 1304
1297 ctx->vif = NULL; 1305 ctx->vif = NULL;