]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf trace: Avoid an ERR_PTR in syscall_stats
authorIan Rogers <irogers@google.com>
Mon, 2 Mar 2026 23:45:15 +0000 (15:45 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 3 Mar 2026 01:13:19 +0000 (17:13 -0800)
commitd05073adda0f047e9b2115a2932bcb2797eab238
tree124d44ec5615a6859b2d138443ed7a44640b909d
parent06ec44c2aa2ef15fd56f9808b6cf7495e1fbd8ec
perf trace: Avoid an ERR_PTR in syscall_stats

hashmap__new may return an ERR_PTR and previously this would be
assigned to syscall_stats meaning all use of syscall_stats needs to
test for NULL (uninitialized) or an ERR_PTR. Given the only reason
hashmap__new can fail is ENOMEM, just use NULL to indicate the
allocation failure and avoid the code having to test for NULL and
IS_ERR.

Fixes: 96f202eab813 (perf trace: Fix IS_ERR() vs NULL check bug)
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-trace.c