diff options
-rw-r--r-- | kernel/workqueue.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 62d47220696..e72fb6478da 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -315,6 +315,11 @@ struct workqueue_struct *__create_workqueue(const char *name, return NULL; wq->cpu_wq = alloc_percpu(struct cpu_workqueue_struct); + if (!wq->cpu_wq) { + kfree(wq); + return NULL; + } + wq->name = name; /* We don't need the distraction of CPUs appearing and vanishing. */ lock_cpu_hotplug(); |