]> git.baikalelectronics.ru Git - kernel.git/commit
perf parse-events: Check if the software events array slots are populated
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 19 May 2021 16:50:31 +0000 (13:50 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 21 May 2021 10:47:56 +0000 (07:47 -0300)
commit9165d09606db18eb622b3a90aed1ecf3acc8e9d2
treee69f72cb5ededab886aa7e1db09f8a184a7c4818
parent1f2d346a5a4ab7ed94371ab1a11d6f992278881c
perf parse-events: Check if the software events array slots are populated

To avoid a NULL pointer dereference when the kernel supports the new
feature but the tooling still hasn't an entry for it.

This happened with the recently added PERF_COUNT_SW_CGROUP_SWITCHES
software event.

Reported-by: Thomas Richter <tmricht@linux.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Link: https://lore.kernel.org/linux-perf-users/YKVESEKRjKtILhog@kernel.org/
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/parse-events.c