OpenCloudOS-Kernel/tools/perf/ui/browsers
Leo Yan ceb75476db perf hists browser: Fix potential NULL pointer dereference found by the smatch tool
Based on the following report from Smatch, fix the potential
NULL pointer dereference check.

  tools/perf/ui/browsers/hists.c:641
  hist_browser__run() error: we previously assumed 'hbt' could be
  null (see line 625)

  tools/perf/ui/browsers/hists.c:3088
  perf_evsel__hists_browse() error: we previously assumed
  'browser->he_selection' could be null (see line 2902)

  tools/perf/ui/browsers/hists.c:3272
  perf_evsel_menu__run() error: we previously assumed 'hbt' could be
  null (see line 3260)

This patch firstly validating the pointers before access them, so can
fix potential NULL pointer dereference.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20190708143937.7722-2-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-07-09 10:13:27 -03:00
..
Build perf report: Implement browsing of individual samples 2019-03-11 16:33:19 -03:00
annotate.c tools lib: Adopt zalloc()/zfree() from tools/perf 2019-07-09 10:13:26 -03:00
header.c perf tools: Replace automatic const char[] variables by statics 2019-01-21 15:15:57 -03:00
hists.c perf hists browser: Fix potential NULL pointer dereference found by the smatch tool 2019-07-09 10:13:27 -03:00
hists.h perf hists browser: Pass annotation_options from tool to browser 2018-06-04 10:28:53 -03:00
map.c perf tools: Add missing headers, mostly stdlib.h 2019-07-09 10:13:22 -03:00
map.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
res_sample.c perf tools: Use zfree() where applicable 2019-07-09 10:13:27 -03:00
scripts.c perf tools: Use zfree() where applicable 2019-07-09 10:13:27 -03:00