[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1542786011-18150-1-git-send-email-wen.yang99@zte.com.cn>
Date: Wed, 21 Nov 2018 15:40:11 +0800
From: Wen Yang <wen.yang99@....com.cn>
To: peterz@...radead.org
Cc: mingo@...hat.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
namhyung@...nel.org, adrian.hunter@...el.com, ak@...ux.intel.com,
linux-kernel@...r.kernel.org, zhong.weidong@....com.cn,
wang.yi59@....com.cn, wen.yang99@....com.cn,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 1/4] perf intel-pt: fix potential NULL pointer dereference in intel_pt_process_auxtrace_info
This patch fixes a possible null pointer dereference in
intel_pt_process_auxtrace_info, detected by the semantic patch
deref_null.cocci, with the following warning:
./tools/perf/util/intel-pt.c:2579:32-49: ERROR: session -> itrace_synth_opts is NULL but dereferenced.
Signed-off-by: Wen Yang <wen.yang99@....com.cn>
Reviewed-by: Tan Hu <tan.hu@....com.cn>
CC: Julia Lawall <julia.lawall@...6.fr>
---
tools/perf/util/intel-pt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 149ff36..bac20e8 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2575,7 +2575,8 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
if (session->itrace_synth_opts && session->itrace_synth_opts->set) {
pt->synth_opts = *session->itrace_synth_opts;
} else {
- itrace_synth_opts__set_default(&pt->synth_opts,
+ if (session->itrace_synth_opts)
+ itrace_synth_opts__set_default(&pt->synth_opts,
session->itrace_synth_opts->default_no_sample);
if (use_browser != -1) {
pt->synth_opts.branches = false;
--
2.9.5
Powered by blists - more mailing lists