public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] perf script: Make itrace script default to all calls
@ 2019-04-04 11:06 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2019-04-04 11:06 UTC (permalink / raw)
  To: kernel-janitors

Hello Andi Kleen,

This is a semi-automatic email about new static checker warnings.

The patch 4eb068157121: "perf script: Make itrace script default to 
all calls" from Sep 20, 2018, leads to the following Smatch complaint:

    ./tools/perf/util/intel-pt.c:2595 intel_pt_process_auxtrace_info()
    warn: variable dereferenced before check 'session->itrace_synth_opts' (see line 2590)

./tools/perf/util/intel-pt.c
  2589			itrace_synth_opts__set_default(&pt->synth_opts,
  2590					session->itrace_synth_opts->default_no_sample);
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The patch added a new dereference

  2591			if (use_browser != -1) {
  2592				pt->synth_opts.branches = false;
  2593				pt->synth_opts.callchain = true;
  2594			}
  2595			if (session->itrace_synth_opts)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^
but the existing code checked for NULL.

  2596				pt->synth_opts.thread_stack   2597					session->itrace_synth_opts->thread_stack;

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [bug report] perf script: Make itrace script default to all calls
@ 2018-11-28 14:37 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2018-11-28 14:37 UTC (permalink / raw)
  To: kernel-janitors

Hello Andi Kleen,

This is a semi-automatic email about new static checker warnings.

The patch 4eb068157121: "perf script: Make itrace script default to 
all calls" from Sep 20, 2018, leads to the following Smatch complaint:

    ./tools/perf/util/intel-pt.c:2579 intel_pt_process_auxtrace_info()
     error: we previously assumed 'session->itrace_synth_opts' could be null (see line 2575)

./tools/perf/util/intel-pt.c
  2574	
  2575		if (session->itrace_synth_opts && session->itrace_synth_opts->set) {
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
The old code assumed this could be NULL.

  2576			pt->synth_opts = *session->itrace_synth_opts;
  2577		} else {
  2578			itrace_synth_opts__set_default(&pt->synth_opts,
  2579					session->itrace_synth_opts->default_no_sample);
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
But the patch adds an unchecked dereference.

  2580			if (use_browser != -1) {
  2581				pt->synth_opts.branches = false;

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-04 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-04 11:06 [bug report] perf script: Make itrace script default to all calls Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2018-11-28 14:37 Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox