mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
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>
This commit is contained in:
parent
f6e1d8cc38
commit
5c788a695a
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue