diff options
| author | Andi Kleen <[email protected]> | 2024-01-30 18:55:52 +0000 |
|---|---|---|
| committer | Namhyung Kim <[email protected]> | 2024-02-02 06:15:31 +0000 |
| commit | 1c84b47f99ea7ab7a76a785edd29e14977e1ecd0 (patch) | |
| tree | a5d630f7a6675168dc093d2e599a091611cd77c9 /tools/perf/util/sort.c | |
| parent | perf evsel: Fix duplicate initialization of data->id in evsel__parse_sample() (diff) | |
| download | kernel-1c84b47f99ea7ab7a76a785edd29e14977e1ecd0.tar.gz kernel-1c84b47f99ea7ab7a76a785edd29e14977e1ecd0.zip | |
perf report: Prevent segfault with --no-parent
Prevent a perf report segfault with the (non sensical) --no-parent
option
Signed-off-By: Andi Kleen <[email protected]>
Acked-by: Namhyung <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/util/sort.c')
| -rw-r--r-- | tools/perf/util/sort.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 30254eb63709..92a1bd695e8a 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -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]; |
