perf report: Fix NULL pointer dereference in hists__fprintf_nr_sample_events()
authorGaurav Singh <gaurav1086@gmail.com>
Mon, 8 Jun 2020 16:18:17 +0000 (13:18 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:50:45 +0000 (17:50 +0200)
commit676634f1a831194649b867e43b4cd1d75ecf9372
treefcdb9c28544953afc3a7b54e0fc0ce604f3a19c6
parent335d720bb4bd9d2808cae5af6f3c636c87f19596
perf report: Fix NULL pointer dereference in hists__fprintf_nr_sample_events()

[ Upstream commit 11b6e5482e178055ec1f2444b55f2518713809d1 ]

The 'evname' variable can be NULL, as it is checked a few lines back,
check it before using.

Fixes: 9e207ddfa207 ("perf report: Show call graph from reference events")
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/builtin-report.c