Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932559AbZLFJZ1 (ORCPT ); Sun, 6 Dec 2009 04:25:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755858AbZLFJZW (ORCPT ); Sun, 6 Dec 2009 04:25:22 -0500 Received: from hera.kernel.org ([140.211.167.34]:50398 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755841AbZLFJZV (ORCPT ); Sun, 6 Dec 2009 04:25:21 -0500 Date: Sun, 6 Dec 2009 09:24:44 GMT From: tip-bot for Julia Lawall 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 Reply-To: mingo@redhat.com, hpa@zytor.com, julia@diku.dk, paulus@samba.org, acme@redhat.com, linux-kernel@vger.kernel.org, fweisbec@gmail.com, a.p.zijlstra@chello.nl, efault@gmx.de, tglx@linutronix.de, mingo@elte.hu In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf tools: Correct size computation in tracepoint_id_to_path() Message-ID: Git-Commit-ID: 59b4caeb797494043f5f3b98a610f5d9b75eefa3 X-Mailer: tip-git-log-daemon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1830 Lines: 56 Commit-ID: 59b4caeb797494043f5f3b98a610f5d9b75eefa3 Gitweb: http://git.kernel.org/tip/59b4caeb797494043f5f3b98a610f5d9b75eefa3 Author: Julia Lawall AuthorDate: Sun, 6 Dec 2009 10:16:30 +0100 Committer: Ingo Molnar 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/) // @expression@ expression *x; @@ x = <+... -sizeof(x) +sizeof(*x) ...+>// Signed-off-by: Julia Lawall Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker LKML-Reference: Signed-off-by: Ingo Molnar --- 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/