diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-12-04 15:18:01 -0800 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-12-04 15:18:01 -0800 |
commit | 5c788a695ab5740413d9f9c0035d0d7aeef1c708 (patch) | |
tree | 8cfa260d86f7c122a501e20723394eeef1b8e3f5 /drivers/pci/hotplug/ibmphp_hpc.c | |
parent | f6e1d8cc38b3776038fb15d3acc82ed8bb552f82 (diff) |
PCI: ibmphp_hpc: don't release hw sem twice if kthread stops
If we stop the kthread, we may end up up'ing the sem twice, which seems
unintended.
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/ibmphp_hpc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c index 83f337c891a..c7084f0eca5 100644 --- a/drivers/pci/hotplug/ibmphp_hpc.c +++ b/drivers/pci/hotplug/ibmphp_hpc.c @@ -890,7 +890,7 @@ static int poll_hpc(void *data) msleep(POLL_INTERVAL_SEC * 1000); if (kthread_should_stop()) - break; + goto out_sleep; down (&semOperations); @@ -904,6 +904,7 @@ static int poll_hpc(void *data) /* give up the hardware semaphore */ up (&semOperations); /* sleep for a short time just for good measure */ +out_sleep: msleep(100); } up (&sem_exit); |