From: tip-bot for Julia Lawall <julia@diku.dk>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, acme@redhat.com, paulus@samba.org,
julia@diku.dk, hpa@zytor.com, mingo@redhat.com,
a.p.zijlstra@chello.nl, efault@gmx.de, fweisbec@gmail.com,
tglx@linutronix.de, mingo@elte.hu
Subject: [tip:perf/urgent] perf tools: Correct size computation in tracepoint_id_to_path()
Date: Sun, 6 Dec 2009 09:24:44 GMT [thread overview]
Message-ID: <tip-59b4caeb797494043f5f3b98a610f5d9b75eefa3@git.kernel.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0912061016120.20858@ask.diku.dk>
Commit-ID: 59b4caeb797494043f5f3b98a610f5d9b75eefa3
Gitweb: http://git.kernel.org/tip/59b4caeb797494043f5f3b98a610f5d9b75eefa3
Author: Julia Lawall <julia@diku.dk>
AuthorDate: Sun, 6 Dec 2009 10:16:30 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 6 Dec 2009 10:21:59 +0100
perf tools: Correct size computation in tracepoint_id_to_path()
The size argument to zalloc should be the size of desired
structure, not the pointer to it.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@expression@
expression *x;
@@
x =
<+...
-sizeof(x)
+sizeof(*x)
...+>// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <Pine.LNX.4.64.0912061016120.20858@ask.diku.dk>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/util/parse-events.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 9e5dbd6..448a13b 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -197,7 +197,7 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
if (id == config) {
closedir(evt_dir);
closedir(sys_dir);
- path = zalloc(sizeof(path));
+ path = zalloc(sizeof(*path));
path->system = malloc(MAX_EVENT_LENGTH);
if (!path->system) {
free(path);
next prev parent reply other threads:[~2009-12-06 9:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-06 9:16 [PATCH 4/5] tools/perf/util: correct size computation Julia Lawall
2009-12-06 9:24 ` tip-bot for Julia Lawall [this message]
2009-12-07 10:08 ` walter harms
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=tip-59b4caeb797494043f5f3b98a610f5d9b75eefa3@git.kernel.org \
--to=julia@diku.dk \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=efault@gmx.de \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome