Commit c8fff3dc authored by Luciano Coelho's avatar Luciano Coelho Committed by Johannes Berg
Browse files

mac80211: handle drv_add_interface failures properly during reconfig

If any interface fails to be added to the driver in during reconfig,
we should remove all the successfully added interfaces and report
reconfig failure, so things can be cleaned up properly.  Failing to do
so can lead to subsequent failures and leave the drivers in a messed
up state.
Signed-off-by: default avatarLuciano Coelho <>
Signed-off-by: default avatarEmmanuel Grumbach <>
Signed-off-by: default avatarJohannes Berg <>
parent be72afe0
...@@ -1811,8 +1811,25 @@ int ieee80211_reconfig(struct ieee80211_local *local) ...@@ -1811,8 +1811,25 @@ int ieee80211_reconfig(struct ieee80211_local *local)
list_for_each_entry(sdata, &local->interfaces, list) { list_for_each_entry(sdata, &local->interfaces, list) {
if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
sdata->vif.type != NL80211_IFTYPE_MONITOR && sdata->vif.type != NL80211_IFTYPE_MONITOR &&
ieee80211_sdata_running(sdata)) ieee80211_sdata_running(sdata)) {
res = drv_add_interface(local, sdata); res = drv_add_interface(local, sdata);
if (WARN_ON(res))
/* If adding any of the interfaces failed above, roll back and
* report failure.
if (res) {
list_for_each_entry_continue_reverse(sdata, &local->interfaces,
if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
sdata->vif.type != NL80211_IFTYPE_MONITOR &&
drv_remove_interface(local, sdata);
return res;
} }
/* add channel contexts */ /* add channel contexts */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment