diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-08-20 15:36:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-28 14:40:25 -0400 |
commit | 01a0ac417ce9b4f1216a266f2fd454cffefc5aee (patch) | |
tree | 3bc13cf46eebc77a44e65b16132d26f71b131f50 /net/wireless/core.c | |
parent | 40ba60ddfeff8ef42fb33c0bdacfbb5f83e96b32 (diff) |
cfg80211: check lost scans later, fix bug
When we lose a scan, cfg80211 tries to clean up after
the driver. However, it currently does this too early,
it does this in GOING_DOWN already instead of DOWN, so
it may happen with mac80211. Besides fixing this, also
make it more robust by leaking the scan request so if
the driver later actually finishes the scan, it won't
crash. Also check in ___cfg80211_scan_done whether a
scan request is still pending and exit if not.
Reported-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r-- | net/wireless/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 154e1e294cb9..9b157caa74fd 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -664,7 +664,7 @@ static void wdev_cleanup_work(struct work_struct *work) | |||
664 | 664 | ||
665 | if (WARN_ON(rdev->scan_req && rdev->scan_req->dev == wdev->netdev)) { | 665 | if (WARN_ON(rdev->scan_req && rdev->scan_req->dev == wdev->netdev)) { |
666 | rdev->scan_req->aborted = true; | 666 | rdev->scan_req->aborted = true; |
667 | ___cfg80211_scan_done(rdev); | 667 | ___cfg80211_scan_done(rdev, true); |
668 | } | 668 | } |
669 | 669 | ||
670 | cfg80211_unlock_rdev(rdev); | 670 | cfg80211_unlock_rdev(rdev); |
@@ -755,6 +755,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
755 | default: | 755 | default: |
756 | break; | 756 | break; |
757 | } | 757 | } |
758 | break; | ||
759 | case NETDEV_DOWN: | ||
758 | dev_hold(dev); | 760 | dev_hold(dev); |
759 | schedule_work(&wdev->cleanup_work); | 761 | schedule_work(&wdev->cleanup_work); |
760 | break; | 762 | break; |