mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Mathieu Poirier <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org,
	mathieu.poirier@linaro.org, torvalds@linux-foundation.org,
	linux-kernel@vger.kernel.org, efault@gmx.de,
	peterz@infradead.org
Subject: [tip:sched/core] sched/core: Fix &rd->cpudl memory leak
Date: Mon, 30 Jan 2017 03:56:30 -0800	[thread overview]
Message-ID: <tip-4b12db939166042eb78e592bdf94ef113c14e379@git.kernel.org> (raw)
In-Reply-To: <1485292295-21298-2-git-send-email-mathieu.poirier@linaro.org>

Commit-ID:  4b12db939166042eb78e592bdf94ef113c14e379
Gitweb:     http://git.kernel.org/tip/4b12db939166042eb78e592bdf94ef113c14e379
Author:     Mathieu Poirier <mathieu.poirier@linaro.org>
AuthorDate: Tue, 24 Jan 2017 14:11:35 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 30 Jan 2017 11:46:37 +0100

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 <mathieu.poirier@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1485292295-21298-2-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 17d1df6..d01f9d0 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:

  reply	other threads:[~2017-01-30 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 21:11 [PATCH 1/2] sched/core: Fix &rd->rto_mask " Mathieu Poirier
2017-01-24 21:11 ` [PATCH 2/2] sched/core: Fix &rd->cpudl " Mathieu Poirier
2017-01-30 11:56   ` tip-bot for Mathieu Poirier [this message]
2017-01-30 11:56 ` [tip:sched/core] sched/core: Fix &rd->rto_mask " tip-bot for Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-4b12db939166042eb78e592bdf94ef113c14e379@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome