mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: David Teigland <[email protected]>
This commit is contained in:
parent
f92c8dd7a0
commit
b9d4105279
1 changed files with 6 additions and 9 deletions
|
|
@ -1468,22 +1468,19 @@ static void work_stop(void)
|
|||
|
||||
static int work_start(void)
|
||||
{
|
||||
int error;
|
||||
recv_workqueue = alloc_workqueue("dlm_recv", WQ_MEM_RECLAIM |
|
||||
WQ_HIGHPRI | WQ_FREEZEABLE, 0);
|
||||
error = IS_ERR(recv_workqueue);
|
||||
if (error) {
|
||||
log_print("can't start dlm_recv %d", error);
|
||||
return error;
|
||||
if (!recv_workqueue) {
|
||||
log_print("can't start dlm_recv");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
send_workqueue = alloc_workqueue("dlm_send", WQ_MEM_RECLAIM |
|
||||
WQ_HIGHPRI | WQ_FREEZEABLE, 0);
|
||||
error = IS_ERR(send_workqueue);
|
||||
if (error) {
|
||||
log_print("can't start dlm_send %d", error);
|
||||
if (!send_workqueue) {
|
||||
log_print("can't start dlm_send");
|
||||
destroy_workqueue(recv_workqueue);
|
||||
return error;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue