<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From keithmo@exmsft.com Thu Jun  2 03:55:49 2005
Message-ID: &lt;429EE29D.8030805@exmsft.com&gt;
Date: Thu, 02 Jun 2005 12:42:37 +0200
From: Keith Moore &lt;keithmo@exmsft.com&gt;
To: Greg KH &lt;greg@kroah.com&gt;
Subject: cpqphp: fix oops during unload without probe

drivers/pci/hotplug/cpqphp_core.c calls cpqphp_event_start_thread()
in one_time_init(), which is called whenever the hardware is probed.
Unfortunately, cpqphp_event_stop_thread() is *always* called when
the module is unloaded. If the hardware is never probed, then
cpqphp_event_stop_thread() tries to manipulate a couple of
uninitialized mutexes.

Signed-off-by: Keith Moore &lt;keithmo@exmsft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


---
 drivers/pci/hotplug/cpqphp_core.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

--- gregkh-2.6.orig/drivers/pci/hotplug/cpqphp_core.c	2005-06-06 12:08:52.000000000 -0700
+++ gregkh-2.6/drivers/pci/hotplug/cpqphp_core.c	2005-06-09 21:42:12.000000000 -0700
@@ -60,6 +60,7 @@
 static void __iomem *cpqhp_rom_start;
 static int power_mode;
 static int debug;
+static int initialized;
 
 #define DRIVER_VERSION	"0.9.8"
 #define DRIVER_AUTHOR	"Dan Zink &lt;dan.zink@compaq.com&gt;, Greg Kroah-Hartman &lt;greg@kroah.com&gt;"
@@ -1271,7 +1272,6 @@
 {
 	int loop;
 	int retval = 0;
-	static int initialized = 0;
 
 	if (initialized)
 		return 0;
@@ -1441,7 +1441,8 @@
 	}
 
 	// Stop the notification mechanism
-	cpqhp_event_stop_thread();
+	if (initialized)
+		cpqhp_event_stop_thread();
 
 	//unmap the rom address
 	if (cpqhp_rom_start)
</pre></body></html>