smalloc: OOM fixups
[fio.git] / workqueue.c
index 013087e10561128bfb6f51b03abc32f63a9d3964..1131400fd23a5acc8479c813fef0135c4987cf30 100644 (file)
@@ -323,6 +323,8 @@ int workqueue_init(struct thread_data *td, struct workqueue *wq,
                goto err;
 
        wq->workers = smalloc(wq->max_workers * sizeof(struct submit_worker));
+       if (!wq->workers)
+               goto err;
 
        for (i = 0; i < wq->max_workers; i++)
                if (start_worker(wq, i, sk_out))