Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp873089ybl; Fri, 10 Jan 2020 08:08:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxcsLzEuaYyTFk0dRPSdyrhaY0/2HO/RbZR5wi+Pe/0sxluiDyZ4kC5tK5awnflgAHGqBQE X-Received: by 2002:a05:6830:1047:: with SMTP id b7mr3347686otp.77.1578672500561; Fri, 10 Jan 2020 08:08:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578672500; cv=none; d=google.com; s=arc-20160816; b=wtHNZaSR0Jt1k3Q5Vf9+aCNmfq4ifKNarq5oCU09kXSGCk+R1nVUsVkM63KYwCjXoP YTwRoUsXTW6SKhuZfoSM4STPjb80Eeg0QwNuQl341BRCEMJXcFrhXiUyUsX3dZj4Fv1v fGoEL5jtTymoq410bC4eXG2IFNWErS6VlcGW0zgwYlrcItbMeUrCYQrNvO8HPMtV3Y56 lVF2YomqthgwrexE+BesUpRSyzDouk2SE3o2yHGGMxCmWRe6jmHFrHfeOZNM8MDUxGHw YZoZSgEHQMZEJZxu+/ILvDoL4ZCmbTVU59+/BTc2+zvYr9b5ReVcUP+IJhhPg9LqN6G6 nmJg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XnjUsiNnnEzaBIJtR/iQv/AqQtVBBqh6j9V9R17KEu8=; b=uR9OgIK0dqtipJjtDLCClcBQ7AkU/XP9wp6MJ/2T6OGlspyIqIr6bx3sTyFIJrWIqy ezQxt/HytD9JRmurFNQTMWewP9LvuKwtegO0UGJldPbHtsqyoo0cW+bgMXi7AURt1STb ouwl2Y6/4cThoX6bT619qMeAbSQKLStAS9fHXbRXmmenXR9aLhfkd1iOcEv9vHcZTtP7 zQkYsIDBlIT0ESIB5aoiaKDtGMPFvZl+G/oDvJgbeODjZalHe1AMfJ8EiLZ1U0HvSHnx 1rinzk6B+TDRl2jZ23WRimDVOqy4xiwHL49bwSg3Wlzkt+GXeAplZu+nN6W2ADy+5iJX a6pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fWI5KiSe; 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: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21si1537428otj.282.2020.01.10.08.08.06; Fri, 10 Jan 2020 08:08:20 -0800 (PST) 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=fWI5KiSe; 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 S1728842AbgAJQGN (ORCPT + 99 others); Fri, 10 Jan 2020 11:06:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:54686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728497AbgAJQGM (ORCPT ); Fri, 10 Jan 2020 11:06:12 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC1EE208E4; Fri, 10 Jan 2020 16:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578672371; bh=5PhsvcLu2SEfj/jWR5AT1Tp2dDe9WXeiCF0tfbbG4MA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fWI5KiSedCdj7E38HDknQEUlKRNPt/juS5KVx3bkp0HFclEozmqP084DJaTuM+/iX GkQ/VXd+V2wPl/1BcgPQMo+4V60gQLkrEJzFqlJOZM8/JRL3UMafduzBi5B9+9ce5v XDvSCU0pzlMSutp0sq0i1b+DFEVgX+IOGqk6NyN8= From: Masami Hiramatsu To: Steven Rostedt Cc: Ingo Molnar , Frank Rowand , Randy Dunlap , Namhyung Kim , Tim Bird , Jiri Olsa , Arnaldo Carvalho de Melo , Tom Zanussi , Rob Herring , Andrew Morton , Thomas Gleixner , Greg Kroah-Hartman , Alexey Dobriyan , Jonathan Corbet , Linus Torvalds , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 14/22] tracing: Add NULL trace-array check in print_synth_event() Date: Sat, 11 Jan 2020 01:06:05 +0900 Message-Id: <157867236536.17873.12529350542460184019.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157867220019.17873.13377985653744804396.stgit@devnote2> References: <157867220019.17873.13377985653744804396.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add NULL trace-array check in print_synth_event(), because if we enable tp_printk option, iter->tr can be NULL. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_events_hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index dae2c25b209a..137fc50f2b35 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -833,7 +833,7 @@ static enum print_line_t print_synth_event(struct trace_iterator *iter, fmt = synth_field_fmt(se->fields[i]->type); /* parameter types */ - if (tr->trace_flags & TRACE_ITER_VERBOSE) + if (tr && tr->trace_flags & TRACE_ITER_VERBOSE) trace_seq_printf(s, "%s ", fmt); snprintf(print_fmt, sizeof(print_fmt), "%%s=%s%%s", fmt);