diff options
author | Namhyung Kim <namhyung@gmail.com> | 2010-12-13 14:42:24 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2010-12-13 14:42:24 -0500 |
commit | b9d41052794385f9d47ebb7acf4a772f3ad02398 (patch) | |
tree | 3908936d603917c36079a595e85ba0abd72b1c1c /fs/dlm | |
parent | f92c8dd7a0eb18124521e2b549f88422e17f707b (diff) |
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: Namhyung Kim <namhyung@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/lowcomms.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 0e75f152eac2..9c64ae9e4c1a 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
@@ -1468,22 +1468,19 @@ static void work_stop(void) | |||
1468 | 1468 | ||
1469 | static int work_start(void) | 1469 | static int work_start(void) |
1470 | { | 1470 | { |
1471 | int error; | ||
1472 | recv_workqueue = alloc_workqueue("dlm_recv", WQ_MEM_RECLAIM | | 1471 | recv_workqueue = alloc_workqueue("dlm_recv", WQ_MEM_RECLAIM | |
1473 | WQ_HIGHPRI | WQ_FREEZEABLE, 0); | 1472 | WQ_HIGHPRI | WQ_FREEZEABLE, 0); |
1474 | error = IS_ERR(recv_workqueue); | 1473 | if (!recv_workqueue) { |
1475 | if (error) { | 1474 | log_print("can't start dlm_recv"); |
1476 | log_print("can't start dlm_recv %d", error); | 1475 | return -ENOMEM; |
1477 | return error; | ||
1478 | } | 1476 | } |
1479 | 1477 | ||
1480 | send_workqueue = alloc_workqueue("dlm_send", WQ_MEM_RECLAIM | | 1478 | send_workqueue = alloc_workqueue("dlm_send", WQ_MEM_RECLAIM | |
1481 | WQ_HIGHPRI | WQ_FREEZEABLE, 0); | 1479 | WQ_HIGHPRI | WQ_FREEZEABLE, 0); |
1482 | error = IS_ERR(send_workqueue); | 1480 | if (!send_workqueue) { |
1483 | if (error) { | 1481 | log_print("can't start dlm_send"); |
1484 | log_print("can't start dlm_send %d", error); | ||
1485 | destroy_workqueue(recv_workqueue); | 1482 | destroy_workqueue(recv_workqueue); |
1486 | return error; | 1483 | return -ENOMEM; |
1487 | } | 1484 | } |
1488 | 1485 | ||
1489 | return 0; | 1486 | return 0; |