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

Commit 5869b506 authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Linus Torvalds
Browse files

smpboot: fix memory leak on error handling



The cpumask is allocated before threads get created. If the latter step
fails, we need to free the cpumask.

Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Reviewed-by: default avatarChris Metcalf <cmetcalf@ezchip.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a068acf2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -301,6 +301,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)
		ret = __smpboot_create_thread(plug_thread, cpu);
		if (ret) {
			smpboot_destroy_threads(plug_thread);
			free_cpumask_var(plug_thread->cpumask);
			goto out;
		}
		smpboot_unpark_thread(plug_thread, cpu);