Message ID | 20190709183126.30257-9-acme@kernel.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8896651ilk; Tue, 9 Jul 2019 11:32:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjY/9BvER9bep6jlBAd2wEppnOB8mXHcsTxgCAu0T9TiPWWD3OnBwcxZt+5FfdO9MoFXKB X-Received: by 2002:a65:6081:: with SMTP id t1mr18894787pgu.9.1562697149645; Tue, 09 Jul 2019 11:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562697149; cv=none; d=google.com; s=arc-20160816; b=qANsNr8R3klYhwKsGUGI+SVVvm26alogGgD7Z5CNThahd30JtD79g5SkPDY9oVK7XY AW2NO2EndMxXBq5OHmHo/X9DxqInQxG8cTMsifTwj+pQQM6vd5/OrLTF/WHSSZbjhSFn asYLu6iB+y3mM9jNgSNvVZcUjiD+irceXQ79Jm5EqucI3u3aMkhae26WKeGuTq+tK/z5 oJZOwdrYbBiZnbMGKoB+vK+A3V+eygz0iXL84m9aqa/poGjehTDIBsrWly+IJ9XBClVb MJsznfp3hFyv0fw/CS4tLOeOMiQc2cV8FXtjyWJGJ1nveW6LMQfQfzA6yOkx5luer1IL Hvew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4OXxn3DW2sslp44VkLFd6P05tzxSwup5/MayWZIMCbo=; b=N/4C7SAEjzI6nmqvd+gmJLyojYVLggGkNCRUkKsJOlQFz6YDiKGbdCWA4X3hM/ET/Q FHn7TTOcxM5LyuK4slfKhwCqw0sCc1a8zyWUaipE9o81qBTftVvvj/hU6JqAFkGAeHxb /oUzqJmkIWJMNHJnO0B1c2xDX7XIKEIsIMmMr9ezDW3xmnnpue+YaHvB8iNegzS/HJCL xhq/I/uXwKDMb+CMHZQXZA+RwI3QGD4AvbjMfS7Vv1w1ycla4teEnBhSh74jbOF/2vrC ueTGHpQuiQrgdC4ZL2dpdDM2a0drdFJbAlxtZmcjZnvrt01lj4FhugJlOryKI10IOttw umsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="am5/w0YM"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19si24636534pgl.389.2019.07.09.11.32.29; Tue, 09 Jul 2019 11:32:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="am5/w0YM"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729140AbfGISc2 (ORCPT <rfc822;mike.holmes@linaro.org> + 30 others); Tue, 9 Jul 2019 14:32:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:53836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729094AbfGISc0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 9 Jul 2019 14:32:26 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.35.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7FD7221743; Tue, 9 Jul 2019 18:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562697145; bh=LzlQIF4A49g3wOWfYMbmSZepSv/fUbacMvy8iT48q8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=am5/w0YM83bIKrJUqGCW+batDUhjaHXgi7HVsURprAOsei5iju27lqv0YAlsH85VU gd182DK8TEn/+xmW4r92QB0t6z3ZrhmYxFogvmwnbbPbPg2OAa5pP6UQ1vBBKrZeue YwL8273Rnsy8SQJQpTxUxUFXfQEjK59/9glm9X5Y= From: Arnaldo Carvalho de Melo <acme@kernel.org> To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de> Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Clark Williams <williams@redhat.com>, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Leo Yan <leo.yan@linaro.org>, Adrian Hunter <adrian.hunter@intel.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Alexey Budankov <alexey.budankov@linux.intel.com>, Alexios Zavras <alexios.zavras@intel.com>, Andi Kleen <ak@linux.intel.com>, Changbin Du <changbin.du@intel.com>, "David S . Miller" <davem@davemloft.net>, Davidlohr Bueso <dave@stgolabs.net>, Eric Saint-Etienne <eric.saint.etienne@oracle.com>, Jin Yao <yao.jin@linux.intel.com>, Konstantin Khlebnikov <khlebnikov@yandex-team.ru>, Mathieu Poirier <mathieu.poirier@linaro.org>, Peter Zijlstra <peterz@infradead.org>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Song Liu <songliubraving@fb.com>, Suzuki Poulouse <suzuki.poulose@arm.com>, Thomas Richter <tmricht@linux.ibm.com>, linux-arm-kernel@lists.infradead.org, Arnaldo Carvalho de Melo <acme@redhat.com> Subject: [PATCH 08/25] perf session: Fix potential NULL pointer dereference found by the smatch tool Date: Tue, 9 Jul 2019 15:31:09 -0300 Message-Id: <20190709183126.30257-9-acme@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190709183126.30257-1-acme@kernel.org> References: <20190709183126.30257-1-acme@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 54cf163347f7..2e61dd6a3574 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1249,6 +1249,9 @@ static void dump_read(struct perf_evsel *evsel, union perf_event *event) evsel ? perf_evsel__name(evsel) : "FAIL", event->read.value); + if (!evsel) + return; + read_format = evsel->attr.read_format; if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED)