public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Chris Metcalf <cmetcalf@ezchip.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Don Zickus <dzickus@redhat.com>,
	Ulrich Obergfell <uobergfe@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 1/4] smpboot: Fix memory leak on error handling
Date: Sat, 11 Jul 2015 17:52:29 +0200	[thread overview]
Message-ID: <1436629952-17291-2-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1436629952-17291-1-git-send-email-fweisbec@gmail.com>

The cpumask is allocated before threads get created. If the latter step
fails, we need to free the cpumask.

Reviewed-by: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 kernel/smpboot.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index 7c434c3..71aa90b 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -301,6 +301,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)
 		ret = __smpboot_create_thread(plug_thread, cpu);
 		if (ret) {
 			smpboot_destroy_threads(plug_thread);
+			free_cpumask_var(plug_thread->cpumask);
 			goto out;
 		}
 		smpboot_unpark_thread(plug_thread, cpu);
-- 
2.1.4


  reply	other threads:[~2015-07-11 15:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-11 15:52 [PATCH 0/4] smpboot/watchdog: Fixes and cleanups v2 Frederic Weisbecker
2015-07-11 15:52 ` Frederic Weisbecker [this message]
2015-07-12  6:07   ` [PATCH 1/4] smpboot: Fix memory leak on error handling Thomas Gleixner
2015-07-11 15:52 ` [PATCH 2/4] smpboot: Make cleanup to mirror setup Frederic Weisbecker
2015-07-12  6:08   ` Thomas Gleixner
2015-07-11 15:52 ` [PATCH 3/4] smpboot: Allow to pass the cpumask on per-cpu thread registration Frederic Weisbecker
2015-07-12  6:10   ` Thomas Gleixner
2015-07-11 15:52 ` [PATCH 4/4] watchdog: Simplify housekeeping affinity with the appropriate mask Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2015-07-09 15:16 [PATCH 0/4] smpboot/watchdog: Fixes and cleanups Frederic Weisbecker
2015-07-09 15:16 ` [PATCH 1/4] smpboot: Fix memory leak on error handling Frederic Weisbecker

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=1436629952-17291-2-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cmetcalf@ezchip.com \
    --cc=dzickus@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=uobergfe@redhat.com \
    /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