提交 5c788a69 编写于 作者: J Jesse Barnes

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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 f6e1d8cc
...@@ -890,7 +890,7 @@ static int poll_hpc(void *data) ...@@ -890,7 +890,7 @@ static int poll_hpc(void *data)
msleep(POLL_INTERVAL_SEC * 1000); msleep(POLL_INTERVAL_SEC * 1000);
if (kthread_should_stop()) if (kthread_should_stop())
break; goto out_sleep;
down (&semOperations); down (&semOperations);
...@@ -904,6 +904,7 @@ static int poll_hpc(void *data) ...@@ -904,6 +904,7 @@ static int poll_hpc(void *data)
/* give up the hardware semaphore */ /* give up the hardware semaphore */
up (&semOperations); up (&semOperations);
/* sleep for a short time just for good measure */ /* sleep for a short time just for good measure */
out_sleep:
msleep(100); msleep(100);
} }
up (&sem_exit); up (&sem_exit);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册