android_kernel_xiaomi_sm7250/tools/perf/ui
Leo Yan 4fe7ea29e4 perf hists browser: Fix potential NULL pointer dereference found by the smatch tool
[ Upstream commit ceb75476db1617a88cc29b09839acacb69aa076e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-31 07:27:06 +02:00
..
browsers perf hists browser: Fix potential NULL pointer dereference found by the smatch tool 2019-07-31 07:27:06 +02:00
gtk perf hists browser gtk: Use hist_entry__has_callchains() 2018-06-07 14:33:31 -03:00
stdio perf hists: Clarify callchain disabling when available 2018-07-24 14:37:33 -03:00
tui perf ui helpline: Use strlcpy() as a shorter form of strncpy() + explicit set nul 2019-07-03 13:14:41 +02:00
browser.c perf ui browser: Fixup cleaning unused lines at the bottom 2018-04-05 11:51:28 -03:00
browser.h perf ui browser: Move the extra title lines from the hists browser 2018-04-03 10:24:26 -03:00
Build perf build: Add slang objects building 2015-02-12 11:48:13 -03:00
helpline.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
helpline.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hist.c perf hists: Check if a hist_entry has callchains before using them 2018-06-06 12:52:03 -03:00
keysyms.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
libslang.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
progress.c Merge branch 'linus' into perf/core, to fix conflicts 2017-11-07 10:30:18 +01:00
progress.h Merge branch 'linus' into perf/core, to fix conflicts 2017-11-07 10:30:18 +01:00
setup.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ui.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
util.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
util.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00