[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: Keith Moore <keithmo@exmsft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Keith Moore and committed by Greg Kroah-Hartman 4002307d 70549ad9

+3 -2
+3 -2
drivers/pci/hotplug/cpqphp_core.c
··· 60 60 static void __iomem *cpqhp_rom_start; 61 61 static int power_mode; 62 62 static int debug; 63 + static int initialized; 63 64 64 65 #define DRIVER_VERSION "0.9.8" 65 66 #define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>" ··· 1272 1271 { 1273 1272 int loop; 1274 1273 int retval = 0; 1275 - static int initialized = 0; 1276 1274 1277 1275 if (initialized) 1278 1276 return 0; ··· 1441 1441 } 1442 1442 1443 1443 // Stop the notification mechanism 1444 - cpqhp_event_stop_thread(); 1444 + if (initialized) 1445 + cpqhp_event_stop_thread(); 1445 1446 1446 1447 //unmap the rom address 1447 1448 if (cpqhp_rom_start)