aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Poirier <[email protected]>2017-01-24 14:11:35 -0700
committerIngo Molnar <[email protected]>2017-01-30 11:46:37 +0100
commit4b12db939166042eb78e592bdf94ef113c14e379 (patch)
treef2bf11b78cc72503f6925a6e1ee47a55632ae3de
parent92c99ac829931abba33107e09358447c8ad6bd32 (diff)
sched/core: Fix &rd->cpudl memory leak
While in the process of initialising a root domain, if function cpupri_init() fails the memory allocated in cpudl_init() is not reclaimed. Adding a new goto target to cleanup the previous initialistion of the root_domain's dl_bw structure reclaims said memory. Signed-off-by: Mathieu Poirier <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--kernel/sched/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 17d1df6e2dbb..d01f9d047397 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5979,9 +5979,11 @@ static int init_rootdomain(struct root_domain *rd)
goto free_rto_mask;
if (cpupri_init(&rd->cpupri) != 0)
- goto free_rto_mask;
+ goto free_cpudl;
return 0;
+free_cpudl:
+ cpudl_cleanup(&rd->cpudl);
free_rto_mask:
free_cpumask_var(rd->rto_mask);
free_dlo_mask: