Skip to content

Commit

Permalink
[PATCH] cpqphp: fix oops during unload without probe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Keith Moore authored and Greg Kroah-Hartman committed Jun 28, 2005
1 parent 70549ad commit 4002307
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/pci/hotplug/cpqphp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static void __iomem *smbios_start;
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 <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>"
Expand Down Expand Up @@ -1271,7 +1272,6 @@ static int one_time_init(void)
{
int loop;
int retval = 0;
static int initialized = 0;

if (initialized)
return 0;
Expand Down Expand Up @@ -1441,7 +1441,8 @@ static void __exit unload_cpqphpd(void)
}

// Stop the notification mechanism
cpqhp_event_stop_thread();
if (initialized)
cpqhp_event_stop_thread();

//unmap the rom address
if (cpqhp_rom_start)
Expand Down

0 comments on commit 4002307

Please sign in to comment.