Commit 0f8b8245 authored by Eliad Peller's avatar Eliad Peller Committed by Johannes Berg

mac80211: avoid reconfig if no interfaces are up

If there are no interfaces up, there is no reason
to continue the reconfig flow.

The current code might end up calling driver
callbacks (e.g. resume(), reconfig_complete())
while the driver is already stopped.
Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1a952c94
...@@ -1735,6 +1735,10 @@ int ieee80211_reconfig(struct ieee80211_local *local) ...@@ -1735,6 +1735,10 @@ int ieee80211_reconfig(struct ieee80211_local *local)
struct cfg80211_sched_scan_request *sched_scan_req; struct cfg80211_sched_scan_request *sched_scan_req;
bool sched_scan_stopped = false; bool sched_scan_stopped = false;
/* nothing to do if HW shouldn't run */
if (!local->open_count)
goto wake_up;
#ifdef CONFIG_PM #ifdef CONFIG_PM
if (local->suspended) if (local->suspended)
local->resuming = true; local->resuming = true;
...@@ -1756,9 +1760,6 @@ int ieee80211_reconfig(struct ieee80211_local *local) ...@@ -1756,9 +1760,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
reconfig_due_to_wowlan = true; reconfig_due_to_wowlan = true;
} }
#endif #endif
/* everything else happens only if HW was up & running */
if (!local->open_count)
goto wake_up;
/* /*
* Upon resume hardware can sometimes be goofy due to * Upon resume hardware can sometimes be goofy due to
...@@ -2042,7 +2043,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) ...@@ -2042,7 +2043,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
* If this is for hw restart things are still running. * If this is for hw restart things are still running.
* We may want to change that later, however. * We may want to change that later, however.
*/ */
if (!local->suspended || reconfig_due_to_wowlan) if (local->open_count && (!local->suspended || reconfig_due_to_wowlan))
drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART); drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART);
if (!local->suspended) if (!local->suspended)
...@@ -2054,7 +2055,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) ...@@ -2054,7 +2055,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
mb(); mb();
local->resuming = false; local->resuming = false;
if (!reconfig_due_to_wowlan) if (local->open_count && !reconfig_due_to_wowlan)
drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_SUSPEND); drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_SUSPEND);
list_for_each_entry(sdata, &local->interfaces, list) { list_for_each_entry(sdata, &local->interfaces, list) {
......
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