Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH] perf trace: Fix IS_ERR() vs NULL check bug
@ 2026-02-26 12:22 wangguangju
  2026-02-26 15:50 ` Howard Chu
  2026-02-27 21:32 ` Namhyung Kim
  0 siblings, 2 replies; 8+ messages in thread
From: wangguangju @ 2026-02-26 12:22 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, james.clark
  Cc: linux-perf-users, linux-kernel, wangguangju

From: wangguangju <wangguangju@hygon.cn>

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.

Signed-off-by: wangguangju <wangguangju@hygon.cn>
---
 tools/perf/builtin-trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 311d9da9896a..295b272c6c29 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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)
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-03-03 22:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-26 12:22 [PATCH] perf trace: Fix IS_ERR() vs NULL check bug wangguangju
2026-02-26 15:50 ` Howard Chu
2026-02-26 16:32   ` Ian Rogers
2026-02-27 21:32 ` Namhyung Kim
2026-02-28  6:40   ` Ian Rogers
2026-02-28  7:06     ` Howard Chu
2026-03-02 23:45       ` [PATCH v1] perf trace: Avoid an ERR_PTR in syscall_stats Ian Rogers
2026-03-03 22:18         ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox