]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/workqueue.c
Merge pull request #3472 from donaldsharp/flags
[mirror_frr.git] / lib / workqueue.c
index 1af51c06c130ab06c0989a21ce088c8999c0e9a2..c927d5d714118c4745a99cb6358e518f8ae6ba88 100644 (file)
@@ -81,9 +81,6 @@ struct work_queue *work_queue_new(struct thread_master *m,
 
        new = XCALLOC(MTYPE_WORK_QUEUE, sizeof(struct work_queue));
 
-       if (new == NULL)
-               return new;
-
        new->name = XSTRDUP(MTYPE_WORK_QUEUE_NAME, queue_name);
        new->master = m;
        SET_FLAG(new->flags, WQ_UNPLUGGED);
@@ -152,10 +149,7 @@ void work_queue_add(struct work_queue *wq, void *data)
 
        assert(wq);
 
-       if (!(item = work_queue_item_new(wq))) {
-               zlog_err("%s: unable to get new queue item", __func__);
-               return;
-       }
+       item = work_queue_item_new(wq);
 
        item->data = data;
        work_queue_item_enqueue(wq, item);
@@ -245,10 +239,11 @@ int work_queue_run(struct thread *thread)
        char yielded = 0;
 
        wq = THREAD_ARG(thread);
-       wq->thread = NULL;
 
        assert(wq);
 
+       wq->thread = NULL;
+
        /* calculate cycle granularity:
         * list iteration == 1 run
         * listnode processing == 1 cycle