linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mac80211: Prevent unregistering of unregistered hw
@ 2007-03-23 19:21 Ivo van Doorn
  2007-03-23 20:14 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Ivo van Doorn @ 2007-03-23 19:21 UTC (permalink / raw)
  To: Jiri Benc, Linville, John; +Cc: Michael Buesch, linux-wireless, Johannes Berg

At the moment it is possible to call ieee80211_unregister_hw()
for an unregistered hw structure. This will cause a big panic.
This patch will add a BUG_ON() line to warn about this situation.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

---

diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 577dbe3..e7a613d 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -4765,6 +4765,9 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
 	/* TODO: skb_queue should be empty here, no need to do anything? */
 
 	rtnl_lock();
+
+	BUG_ON(local->reg_state != IEEE80211_DEV_REGISTERED);
+
 	local->reg_state = IEEE80211_DEV_UNREGISTERED;
 	if (local->apdev)
 		ieee80211_if_del_mgmt(local);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-03-23 22:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-23 19:21 [PATCH v2] mac80211: Prevent unregistering of unregistered hw Ivo van Doorn
2007-03-23 20:14 ` Johannes Berg
2007-03-23 20:33   ` Jiri Benc
2007-03-23 22:17   ` Ivo van Doorn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).