提交 b9d41052 编写于 作者: N Namhyung Kim 提交者: David Teigland

dlm: sanitize work_start() in lowcomms.c

The create_workqueue() returns NULL if failed rather than ERR_PTR().
Fix error checking and remove unnecessary variable 'error'.
Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: NDavid Teigland <teigland@redhat.com>
上级 f92c8dd7
...@@ -1468,22 +1468,19 @@ static void work_stop(void) ...@@ -1468,22 +1468,19 @@ static void work_stop(void)
static int work_start(void) static int work_start(void)
{ {
int error;
recv_workqueue = alloc_workqueue("dlm_recv", WQ_MEM_RECLAIM | recv_workqueue = alloc_workqueue("dlm_recv", WQ_MEM_RECLAIM |
WQ_HIGHPRI | WQ_FREEZEABLE, 0); WQ_HIGHPRI | WQ_FREEZEABLE, 0);
error = IS_ERR(recv_workqueue); if (!recv_workqueue) {
if (error) { log_print("can't start dlm_recv");
log_print("can't start dlm_recv %d", error); return -ENOMEM;
return error;
} }
send_workqueue = alloc_workqueue("dlm_send", WQ_MEM_RECLAIM | send_workqueue = alloc_workqueue("dlm_send", WQ_MEM_RECLAIM |
WQ_HIGHPRI | WQ_FREEZEABLE, 0); WQ_HIGHPRI | WQ_FREEZEABLE, 0);
error = IS_ERR(send_workqueue); if (!send_workqueue) {
if (error) { log_print("can't start dlm_send");
log_print("can't start dlm_send %d", error);
destroy_workqueue(recv_workqueue); destroy_workqueue(recv_workqueue);
return error; return -ENOMEM;
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册