aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-01-21 07:52:24 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-01-21 11:34:37 -0500
commit54330bf63b49683d006d8f3857d45722a8c0fbff (patch)
tree5de9079c702a8b3bc66a04a02fee3b5058b3c502 /net/mac80211/main.c
parentc1e140bf79d817d4a7aa9932eb98b0359c87af33 (diff)
mac80211: fix HW registration error paths
Station info state is started in allocation, so should be destroyed on free (it's just a timer); rate control must be freed if anything afterwards fails to initialize. LED exit should be later, no need for locking there, but it needs to be done also when rate init failed. Also clean up the code by moving a label so the locking doesn't have to be done separately. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index d9ce33663c73..46264cb6604b 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1041,10 +1041,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1041 ieee80211_max_network_latency; 1041 ieee80211_max_network_latency;
1042 result = pm_qos_add_notifier(PM_QOS_NETWORK_LATENCY, 1042 result = pm_qos_add_notifier(PM_QOS_NETWORK_LATENCY,
1043 &local->network_latency_notifier); 1043 &local->network_latency_notifier);
1044 if (result) { 1044 if (result)
1045 rtnl_lock();
1046 goto fail_pm_qos; 1045 goto fail_pm_qos;
1047 }
1048 1046
1049#ifdef CONFIG_INET 1047#ifdef CONFIG_INET
1050 local->ifa_notifier.notifier_call = ieee80211_ifa_changed; 1048 local->ifa_notifier.notifier_call = ieee80211_ifa_changed;
@@ -1072,15 +1070,15 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1072 fail_ifa: 1070 fail_ifa:
1073 pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY, 1071 pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY,
1074 &local->network_latency_notifier); 1072 &local->network_latency_notifier);
1075 rtnl_lock();
1076#endif 1073#endif
1077 fail_pm_qos: 1074 fail_pm_qos:
1078 ieee80211_led_exit(local); 1075 rtnl_lock();
1076 rate_control_deinitialize(local);
1079 ieee80211_remove_interfaces(local); 1077 ieee80211_remove_interfaces(local);
1080 fail_rate: 1078 fail_rate:
1081 rtnl_unlock(); 1079 rtnl_unlock();
1080 ieee80211_led_exit(local);
1082 ieee80211_wep_free(local); 1081 ieee80211_wep_free(local);
1083 sta_info_stop(local);
1084 destroy_workqueue(local->workqueue); 1082 destroy_workqueue(local->workqueue);
1085 fail_workqueue: 1083 fail_workqueue:
1086 wiphy_unregister(local->hw.wiphy); 1084 wiphy_unregister(local->hw.wiphy);
@@ -1176,6 +1174,8 @@ void ieee80211_free_hw(struct ieee80211_hw *hw)
1176 1174
1177 kfree(rcu_access_pointer(local->tx_latency)); 1175 kfree(rcu_access_pointer(local->tx_latency));
1178 1176
1177 sta_info_stop(local);
1178
1179 wiphy_free(local->hw.wiphy); 1179 wiphy_free(local->hw.wiphy);
1180} 1180}
1181EXPORT_SYMBOL(ieee80211_free_hw); 1181EXPORT_SYMBOL(ieee80211_free_hw);