Skip to content

Commit

Permalink
PCI: ibmphp_hpc: don't release hw sem twice if kthread stops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesse Barnes committed Dec 4, 2009
1 parent f6e1d8c commit 5c788a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/pci/hotplug/ibmphp_hpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 5c788a6

Please sign in to comment.