Explorar o código

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 <lizf@cn.fujitsu.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Li Zefan %!s(int64=16) %!d(string=hai) anos
pai
achega
ca3273f964
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      kernel/sched.c

+ 1 - 0
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
 }