]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf trace: Fix IS_ERR() vs NULL check bug
authorwangguangju <wangguangju@hygon.cn>
Thu, 26 Feb 2026 12:22:08 +0000 (20:22 +0800)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 26 Feb 2026 18:48:14 +0000 (10:48 -0800)
The alloc_syscall_stats() function always returns an error pointer
(ERR_PTR) on failure.

So replace NULL check with IS_ERR() check after calling
delete_syscall_stats() function.

Fixes: ef2da619b132c6f74 ("perf trace: Convert syscall_stats to hashmap")
Signed-off-by: wangguangju <wangguangju@hygon.cn>
Reviewed-by: Howard Chu <howardchu95@gmail.com>
Acked-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-trace.c

index 311d9da9896a41c42574ba8fff9223a3ab01dded..295b272c6c2998a0b0568098150584ebed0dc225 100644 (file)
@@ -1573,7 +1573,7 @@ static void delete_syscall_stats(struct hashmap *syscall_stats)
        struct hashmap_entry *pos;
        size_t bkt;
 
-       if (syscall_stats == NULL)
+       if (IS_ERR(syscall_stats))
                return;
 
        hashmap__for_each_entry(syscall_stats, pos, bkt)