linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rt2x00: Fix OOPS on failed creation of rt2x00lib workqueue
@ 2008-08-02 14:46 Ivo van Doorn
  0 siblings, 0 replies; only message in thread
From: Ivo van Doorn @ 2008-08-02 14:46 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, rt2400-devel, stable

>From a0e6b7826159f3e0eb86a8de74a2bb873b40039c Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Fri, 1 Aug 2008 09:07:21 +0100
Subject: [PATCH] rt2x00: Fix OOPS on failed creation of rt2x00lib workqueue

This fixes a corner case when the rt2x00lib workqueue fails to be created
and rt2x00lib_remove_dev() tries to delete the non-existant workqueue and
causes an OOPS.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
This patch is intended for 2.6.26-stable only, the code in question was introduced
in 2.6.26 and removed for 2.6.27. The bug which is triggered is rare in normal cases,
but guarenteed when using the wrong driver for the wrong hardware (which can
happen when the same USB ID is used in both drivers).

 drivers/net/wireless/rt2x00/rt2x00dev.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index c997d4f..dde6078 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -1198,8 +1198,10 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
 	 * Stop all queued work. Note that most tasks will already be halted
 	 * during rt2x00lib_disable_radio() and rt2x00lib_uninitialize().
 	 */
-	flush_workqueue(rt2x00dev->workqueue);
-	destroy_workqueue(rt2x00dev->workqueue);
+	if (rt2x00dev->workqueue) {
+		flush_workqueue(rt2x00dev->workqueue);
+		destroy_workqueue(rt2x00dev->workqueue);
+	}
 
 	/*
 	 * Free ieee80211_hw memory.
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-02 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-02 14:46 [PATCH] rt2x00: Fix OOPS on failed creation of rt2x00lib workqueue 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).