lkml.org 
[lkml]   [2013]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:perf/urgent] perf/hwbp: Fix cleanup in case of kzalloc() failure
Commit-ID:  e97cbe3edf7d88aad4c21dd3de124d9f9d039881
Gitweb: http://git.kernel.org/tip/e97cbe3edf7d88aad4c21dd3de124d9f9d039881
Author: Daniel Baluta <dbaluta@ixiacom.com>
AuthorDate: Wed, 6 Feb 2013 23:29:20 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 7 Feb 2013 11:52:19 +0100

perf/hwbp: Fix cleanup in case of kzalloc() failure

Obviously this is a typo and could result in memory leaks
if kzalloc fails on a given cpu.

Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: a.p.zijlstra@chello.nl
Cc: paulus@samba.org
Cc: acme@ghostprotocols.net
Link: http://lkml.kernel.org/r/1360186160-7566-1-git-send-email-dbaluta@ixiacom.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/events/hw_breakpoint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
index fe8a916..a64f8ae 100644
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -676,7 +676,7 @@ int __init init_hw_breakpoint(void)
err_alloc:
for_each_possible_cpu(err_cpu) {
for (i = 0; i < TYPE_MAX; i++)
- kfree(per_cpu(nr_task_bp_pinned[i], cpu));
+ kfree(per_cpu(nr_task_bp_pinned[i], err_cpu));
if (err_cpu == cpu)
break;
}

\
 
 \ /
  Last update: 2013-02-07 13:42    [W:0.050 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site