Skip to content

Commit

Permalink
nl80211: Avoid AP mode BUG_ON hang with invalid lock assert
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Feb 27, 2009
1 parent 222d0b3 commit 0bfbce1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion net/wireless/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extern struct list_head cfg80211_drv_list;

static inline void assert_cfg80211_lock(void)
{
BUG_ON(!mutex_is_locked(&cfg80211_mutex));
WARN_ON(!mutex_is_locked(&cfg80211_mutex));
}

/*
Expand Down
2 changes: 0 additions & 2 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
int i;
u16 ifmodes = dev->wiphy.interface_modes;

assert_cfg80211_lock();

hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_WIPHY);
if (!hdr)
return -1;
Expand Down

0 comments on commit 0bfbce1

Please sign in to comment.