Commit 4002307d authored by Keith Moore's avatar Keith Moore Committed by Greg Kroah-Hartman

[PATCH] 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: default avatarKeith Moore <keithmo@exmsft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 70549ad9
...@@ -60,6 +60,7 @@ static void __iomem *smbios_start; ...@@ -60,6 +60,7 @@ static void __iomem *smbios_start;
static void __iomem *cpqhp_rom_start; static void __iomem *cpqhp_rom_start;
static int power_mode; static int power_mode;
static int debug; static int debug;
static int initialized;
#define DRIVER_VERSION "0.9.8" #define DRIVER_VERSION "0.9.8"
#define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>" #define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>"
...@@ -1271,7 +1272,6 @@ static int one_time_init(void) ...@@ -1271,7 +1272,6 @@ static int one_time_init(void)
{ {
int loop; int loop;
int retval = 0; int retval = 0;
static int initialized = 0;
if (initialized) if (initialized)
return 0; return 0;
...@@ -1441,6 +1441,7 @@ static void __exit unload_cpqphpd(void) ...@@ -1441,6 +1441,7 @@ static void __exit unload_cpqphpd(void)
} }
// Stop the notification mechanism // Stop the notification mechanism
if (initialized)
cpqhp_event_stop_thread(); cpqhp_event_stop_thread();
//unmap the rom address //unmap the rom address
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment