From: Li Zefan Date: Fri, 7 Nov 2008 06:47:21 +0000 (+0800) Subject: sched: fix memory leak in a failure path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ca3273f9646694e0419cfb9d6c12deb1c9aff27c;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git sched: fix memory leak in a failure path Impact: fix rare memory leak in the sched-domains manual reconfiguration code In the failure path, rd is not attached to a sched domain, so it causes a leak. Signed-off-by: Li Zefan Acked-by: Peter Zijlstra Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched.c b/kernel/sched.c index 4c7e2bcdfa89..57c933ffbee1 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -7676,6 +7676,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map, error: free_sched_groups(cpu_map, tmpmask); SCHED_CPUMASK_FREE((void *)allmasks); + kfree(rd); return -ENOMEM; #endif }