linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org,
	rt2400-devel@lists.sourceforge.net, stable@kernel.org
Subject: [PATCH] rt2x00: Fix OOPS on failed creation of rt2x00lib workqueue
Date: Sat, 2 Aug 2008 16:46:48 +0200	[thread overview]
Message-ID: <200808021646.49158.IvDoorn@gmail.com> (raw)

>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


                 reply	other threads:[~2008-08-02 14:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200808021646.49158.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rt2400-devel@lists.sourceforge.net \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).