From: Daniel Baluta <dbaluta@ixiacom.com>
To: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com,
acme@ghostprotocols.net, linux-kernel@vger.kernel.org,
fweisbec@gmail.com
Cc: Daniel Baluta <dbaluta@ixiacom.com>
Subject: [PATCH] perf/hwbp: Fix cleanup in case of kzalloc failure
Date: Wed, 6 Feb 2013 23:29:20 +0200 [thread overview]
Message-ID: <1360186160-7566-1-git-send-email-dbaluta@ixiacom.com> (raw)
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
next reply other threads:[~2013-02-06 21:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 21:29 Daniel Baluta [this message]
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
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=1360186160-7566-1-git-send-email-dbaluta@ixiacom.com \
--to=dbaluta@ixiacom.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.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
all inboxes | Powered by JetHome®