From: Li Zefan Date: Fri, 7 Nov 2008 06:47:21 +0000 (+0800) Subject: sched: fix memory leak in a failure path X-Git-Tag: v2.6.28-rc4~17^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ca3273f9646694e0419cfb9d6c12deb1c9aff27c;p=linux-2.6-omap-h63xx.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 4c7e2bcdfa8..57c933ffbee 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 }