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/core.h | |
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/core.h')
-rw-r--r-- | net/wireless/core.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h index 68eaf340d613..d262d42cbd5e 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -380,4 +380,15 @@ int rdev_set_freq(struct cfg80211_registered_device *rdev, | |||
380 | struct wireless_dev *for_wdev, | 380 | struct wireless_dev *for_wdev, |
381 | int freq, enum nl80211_channel_type channel_type); | 381 | int freq, enum nl80211_channel_type channel_type); |
382 | 382 | ||
383 | #ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS | ||
384 | #define CFG80211_DEV_WARN_ON(cond) WARN_ON(cond) | ||
385 | #else | ||
386 | /* | ||
387 | * Trick to enable using it as a condition, | ||
388 | * and also not give a warning when it's | ||
389 | * not used that way. | ||
390 | */ | ||
391 | #define CFG80211_DEV_WARN_ON(cond) ({bool __r = (cond); __r; }) | ||
392 | #endif | ||
393 | |||
383 | #endif /* __NET_WIRELESS_CORE_H */ | 394 | #endif /* __NET_WIRELESS_CORE_H */ |