diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-08-21 06:23:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-28 14:40:30 -0400 |
commit | f7969969f416e593bcc7dc24abf3f9fd6c27136d (patch) | |
tree | 4f4e2ef49d2afae82442ba273d7490938232f113 /net/wireless/ibss.c | |
parent | 3d832611d794b3d312d26a4b251ac5285206f90d (diff) |
cfg80211: make spurious warnings less likely, configurable
Bob reported that he got warnings in IBSS mode about
the ssid_len being zero on a joined event, but only
when kmemcheck was enabled. This appears to be due
to a race condition between drivers and userspace,
when the driver reports joined but the user in the
meantime decided to leave the IBSS again, the warning
would trigger. This was made more likely by kmemcheck
delaying the code that does the check and sends the
event.
So first, make the warning trigger closer to the
driver, which means it's not locked, but since only
the warning depends on it that's ok.
And secondly, users will not want to have spurious
warnings at all, so make those that are known to be
racy in such a way configurable.
Reported-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/ibss.c')
-rw-r--r-- | net/wireless/ibss.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index 42840a01be74..c88338911979 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c | |||
@@ -22,7 +22,7 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid) | |||
22 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_ADHOC)) | 22 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_ADHOC)) |
23 | return; | 23 | return; |
24 | 24 | ||
25 | if (WARN_ON(!wdev->ssid_len)) | 25 | if (!wdev->ssid_len) |
26 | return; | 26 | return; |
27 | 27 | ||
28 | bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, | 28 | bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, |
@@ -58,6 +58,8 @@ void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp) | |||
58 | struct cfg80211_event *ev; | 58 | struct cfg80211_event *ev; |
59 | unsigned long flags; | 59 | unsigned long flags; |
60 | 60 | ||
61 | CFG80211_DEV_WARN_ON(!wdev->ssid_len); | ||
62 | |||
61 | ev = kzalloc(sizeof(*ev), gfp); | 63 | ev = kzalloc(sizeof(*ev), gfp); |
62 | if (!ev) | 64 | if (!ev) |
63 | return; | 65 | return; |