diff options
-rw-r--r-- | net/wireless/core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index fc968c861ee4..c0443558b7bf 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -756,13 +756,16 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev, { struct net_device *dev = wdev->netdev; + ASSERT_RTNL(); + switch (wdev->iftype) { case NL80211_IFTYPE_ADHOC: cfg80211_leave_ibss(rdev, dev, true); break; case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_STATION: - __cfg80211_stop_sched_scan(rdev, false); + if (rdev->sched_scan_req && dev == rdev->sched_scan_req->dev) + __cfg80211_stop_sched_scan(rdev, false); wdev_lock(wdev); #ifdef CONFIG_CFG80211_WEXT |