Commit 1c84b47f authored by Andi Kleen's avatar Andi Kleen Committed by Namhyung Kim

perf report: Prevent segfault with --no-parent

Prevent a perf report segfault with the (non sensical) --no-parent
option
Signed-off-By: default avatarAndi Kleen <ak@linux.intel.com>
Acked-by: default avatarNamhyung <namhyung@kernel.org>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240130185552.150578-1-ak@linux.intel.com
parent 4962aec0
......@@ -3372,7 +3372,7 @@ int sort_dimension__add(struct perf_hpp_list *list, const char *tok,
sort_dimension_add_dynamic_header(sd);
}
if (sd->entry == &sort_parent) {
if (sd->entry == &sort_parent && parent_pattern) {
int ret = regcomp(&parent_regex, parent_pattern, REG_EXTENDED);
if (ret) {
char err[BUFSIZ];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment