Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335887

[PATCH] x86/perf/amd_uncore: Plug reference leak

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject [PATCH] x86/perf/amd_uncore: Plug reference leak
Date 2016-02-16 23:10 +0100
Message-ID <r2VYK-5w0-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Subject: x86/perf/amd_uncore: Plug reference leak
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 03 Feb 2016 09:38:31 +0100

In the error path of amd_uncore_cpu_up_prepare() the newly allocated uncore
struct is freed, but the percpu pointer still references it. Set it to NULL.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/cpu/perf_event_amd_uncore.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/x86/kernel/cpu/perf_event_amd_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_uncore.c
@@ -323,6 +323,8 @@ static int amd_uncore_cpu_up_prepare(uns
 	return 0;
 
 fail:
+	if (amd_uncore_nb)
+		*per_cpu_ptr(amd_uncore_nb, cpu) = NULL;
 	kfree(uncore_nb);
 	return -ENOMEM;
 }

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] x86/perf/amd_uncore: Plug reference leak Thomas Gleixner <tglx@linutronix.de> - 2016-02-16 23:10 +0100
  [tip:perf/core] perf/x86/amd/uncore: Plug reference leak tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-02-17 13:20 +0100

csiph-web