Commit ca3273f9 authored by Li Zefan's avatar Li Zefan Committed by Ingo Molnar

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: default avatarLi Zefan <lizf@cn.fujitsu.com>
Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent f29c9b1c
...@@ -7676,6 +7676,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map, ...@@ -7676,6 +7676,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map,
error: error:
free_sched_groups(cpu_map, tmpmask); free_sched_groups(cpu_map, tmpmask);
SCHED_CPUMASK_FREE((void *)allmasks); SCHED_CPUMASK_FREE((void *)allmasks);
kfree(rd);
return -ENOMEM; return -ENOMEM;
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment