aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-02-24 09:49:58 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:53:04 -0500
commit0bfbce18b9c11201ebf1cfbc0deeab7bdbfe32a5 (patch)
tree71e4bbfbf415dd5f5131a69fc8cd9ad2a0bd3edc /net
parent222d0b33b3778a8fa156f3fca284d0a71f8e966b (diff)
nl80211: Avoid AP mode BUG_ON hang with invalid lock assert
"cfg80211: add assert_cfg80211_lock() to ensure proper protection" added assert_cfg80211_lock() calls into various places. At least one of them, nl80211_send_wiphy(), should not have been there. That triggers the BUG_ON in assert_cfg80211_lock() and pretty much kills the kernel whenever someone runs hostapd.. Remove that call and make assert_cfg80211_lock() use WARN_ON instead of BUG_ON to be a bit more friendly to users. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/core.h2
-rw-r--r--net/wireless/nl80211.c2
2 files changed, 1 insertions, 3 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h
index cd8e6e3ef116..f6c53f5807f4 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -76,7 +76,7 @@ extern struct list_head cfg80211_drv_list;
76 76
77static inline void assert_cfg80211_lock(void) 77static inline void assert_cfg80211_lock(void)
78{ 78{
79 BUG_ON(!mutex_is_locked(&cfg80211_mutex)); 79 WARN_ON(!mutex_is_locked(&cfg80211_mutex));
80} 80}
81 81
82/* 82/*
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 97f69bed3fe2..531bb67cf502 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -137,8 +137,6 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
137 int i; 137 int i;
138 u16 ifmodes = dev->wiphy.interface_modes; 138 u16 ifmodes = dev->wiphy.interface_modes;
139 139
140 assert_cfg80211_lock();
141
142 hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_WIPHY); 140 hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_WIPHY);
143 if (!hdr) 141 if (!hdr)
144 return -1; 142 return -1;