Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf report: Prevent segfault with --no-parent

Prevent a perf report segfault with the (non sensical) --no-parent
option

Signed-off-By: Andi Kleen <ak@linux.intel.com>
Acked-by: Namhyung <namhyung@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240130185552.150578-1-ak@linux.intel.com

authored by

Andi Kleen and committed by
Namhyung Kim
1c84b47f 4962aec0

+1 -1
+1 -1
tools/perf/util/sort.c
··· 3372 3372 sort_dimension_add_dynamic_header(sd); 3373 3373 } 3374 3374 3375 - if (sd->entry == &sort_parent) { 3375 + if (sd->entry == &sort_parent && parent_pattern) { 3376 3376 int ret = regcomp(&parent_regex, parent_pattern, REG_EXTENDED); 3377 3377 if (ret) { 3378 3378 char err[BUFSIZ];