mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf/hwbp: Fix cleanup in case of kzalloc failure
@ 2013-02-06 21:29 Daniel Baluta
  2013-02-06 22:58 ` Frederic Weisbecker
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Baluta @ 2013-02-06 21:29 UTC (permalink / raw)
  To: a.p.zijlstra, paulus, mingo, acme, linux-kernel, fweisbec; +Cc: Daniel Baluta

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>
---
 kernel/events/hw_breakpoint.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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;
 	}
-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-15 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06 21:29 [PATCH] perf/hwbp: Fix cleanup in case of kzalloc failure Daniel Baluta
2013-02-06 22:58 ` Frederic Weisbecker
2013-02-07 12:11 ` [tip:perf/urgent] perf/hwbp: Fix cleanup in case of kzalloc() failure tip-bot for Daniel Baluta
2013-02-15 16:40 ` [tip:perf/core] perf/hwbp: Fix cleanup in case of kzalloc failure tip-bot for Daniel Baluta

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