提交 ddc8f6fe 编写于 作者: D Dave Jiang 提交者: Jon Mason

NTB: Fix incorrect return check in ntb_perf

kthread_create_no_node() returns error pointers, never NULL. Fix check so
it handles error correctly.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDave Jiang <dave.jiang@intel.com>
Signed-off-by: NJon Mason <jdmason@kudzu.us>
上级 2572c7fb
......@@ -615,9 +615,7 @@ static ssize_t debugfs_run_write(struct file *filp, const char __user *ubuf,
kthread_create_on_node(ntb_perf_thread,
(void *)pctx,
node, "ntb_perf %d", i);
if (pctx->thread)
wake_up_process(pctx->thread);
else {
if (IS_ERR(pctx->thread)) {
perf->run = false;
for (i = 0; i < MAX_THREADS; i++) {
if (pctx->thread) {
......@@ -625,7 +623,8 @@ static ssize_t debugfs_run_write(struct file *filp, const char __user *ubuf,
pctx->thread = NULL;
}
}
}
} else
wake_up_process(pctx->thread);
if (perf->run == false)
return -ENXIO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册