All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: Prevent unregistering of unregistered hw
@ 2007-03-09 15:14 Ivo van Doorn
  2007-03-09 15:46 ` Michael Buesch
  0 siblings, 1 reply; 7+ messages in thread
From: Ivo van Doorn @ 2007-03-09 15:14 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

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 check to check if IEEE80211_DEV_REGISTERED
has been set before attempting to unregister hw.

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

---

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

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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-09 15:14 [PATCH] mac80211: Prevent unregistering of unregistered hw Ivo van Doorn
2007-03-09 15:46 ` Michael Buesch
2007-03-09 16:30   ` Ivo van Doorn
2007-03-22 10:37     ` Johannes Berg
2007-03-22 10:49       ` Ivo Van Doorn
2007-03-23 17:36       ` Jiri Benc
2007-03-23 20:08         ` [PATCH] mac80211: BUG_ON unregistering unregistered device Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.