Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757900Ab2HUQNL (ORCPT ); Tue, 21 Aug 2012 12:13:11 -0400 Received: from terminus.zytor.com ([198.137.202.10]:60784 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757847Ab2HUQM7 (ORCPT ); Tue, 21 Aug 2012 12:12:59 -0400 Date: Tue, 21 Aug 2012 09:12:36 -0700 From: tip-bot for Namhyung Kim Message-ID: Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl, namhyung.kim@lge.com, namhyung@kernel.org, tglx@linutronix.de, feng.tang@intel.com Reply-To: mingo@kernel.org, hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org, acme@redhat.com, a.p.zijlstra@chello.nl, namhyung.kim@lge.com, namhyung@kernel.org, tglx@linutronix.de, feng.tang@intel.com In-Reply-To: <1344909423-26384-1-git-send-email-namhyung@kernel.org> References: <1344909423-26384-1-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf script: Fix a NULL pointer dereference Git-Commit-ID: d0d3913895e5b50623bd4dafd876e41c1169031d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (terminus.zytor.com [127.0.0.1]); Tue, 21 Aug 2012 09:12:43 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1608 Lines: 41 Commit-ID: d0d3913895e5b50623bd4dafd876e41c1169031d Gitweb: http://git.kernel.org/tip/d0d3913895e5b50623bd4dafd876e41c1169031d Author: Namhyung Kim AuthorDate: Tue, 14 Aug 2012 10:57:03 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 14 Aug 2012 10:36:30 -0300 perf script: Fix a NULL pointer dereference If 'perf script --gen-script' was called with a perf.data which contains no tracepoint event, it'd segfault due to NULL pevent pointer. Fix it. Signed-off-by: Namhyung Kim Cc: Feng Tang Cc: Ingo Molnar Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1344909423-26384-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/trace-event-parse.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 4cb7f38..a5a554e 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c @@ -293,7 +293,7 @@ struct event_format *trace_find_next_event(struct pevent *pevent, { static int idx; - if (!pevent->events) + if (!pevent || !pevent->events) return NULL; if (!event) { -- 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/