Skip to content

Commit dc3ece1

Browse files
wangguangjugregkh
authored andcommitted
perf trace: Fix IS_ERR() vs NULL check bug
[ Upstream commit 96f202e ] 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: ef2da61 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 02c06e7 commit dc3ece1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/perf/builtin-trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ static void delete_syscall_stats(struct hashmap *syscall_stats)
15731573
struct hashmap_entry *pos;
15741574
size_t bkt;
15751575

1576-
if (syscall_stats == NULL)
1576+
if (IS_ERR(syscall_stats))
15771577
return;
15781578

15791579
hashmap__for_each_entry(syscall_stats, pos, bkt)

0 commit comments

Comments
 (0)