Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 676121fc authored by Ben Collins's avatar Ben Collins Committed by Linus Torvalds
Browse files

[PATCH] Unchecked alloc_percpu() return in __create_workqueue()



__create_workqueue() not checking return of alloc_percpu()

NULL dereference was possible.

Signed-off-by: default avatarBen Collins <bcollins@ubuntu.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9fa37fd1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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();