]> git.baikalelectronics.ru Git - kernel.git/commit
perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc
authorAdrian Hunter <adrian.hunter@intel.com>
Wed, 12 Oct 2022 08:22:58 +0000 (11:22 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 15 Oct 2022 13:13:16 +0000 (10:13 -0300)
commit47286d93af9832fb92b9160794aa367153112f80
tree5874f96c8a47395e7c3742d610dea2bffea5e628
parentfaa80b1a9976eda00c7bc0c21b2abc6bb913b69f
perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc

uClibc segfaulted because NULL was passed as the format to fprintf().

That happened because one of the format strings was missing and
intel_pt_print_info() didn't check that before calling fprintf().

Add the missing format string, and check format is not NULL before calling
fprintf().

Fixes: 3ea2f9522652918a ("perf tools: Pass Intel PT information for decoding MTC and CYC")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221012082259.22394-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/intel-pt.c