All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf bench: Fix null check
@ 2022-03-11 13:07 Weiguo Li
  2022-03-11 19:08 ` Davidlohr Bueso
  0 siblings, 1 reply; 3+ messages in thread
From: Weiguo Li @ 2022-03-11 13:07 UTC (permalink / raw)
  To: dave, dbueso, peterz, mingo, acme
  Cc: mark.rutland, alexander.shishkin, jolsa, namhyung,
	linux-perf-users, linux-kernel

We did a null check after "epollfdp = calloc(...)", but we checked
"epollfd" instead of "epollfdp".

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
 tools/perf/bench/epoll-ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c
index 740ae764537e..134612bde0cb 100644
--- a/tools/perf/bench/epoll-ctl.c
+++ b/tools/perf/bench/epoll-ctl.c
@@ -106,7 +106,7 @@ static void nest_epollfd(void)
 	printinfo("Nesting level(s): %d\n", nested);
 
 	epollfdp = calloc(nested, sizeof(int));
-	if (!epollfd)
+	if (!epollfdp)
 		err(EXIT_FAILURE, "calloc");
 
 	for (i = 0; i < nested; i++) {
-- 
2.25.1



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

end of thread, other threads:[~2022-03-12 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-11 13:07 [PATCH] perf bench: Fix null check Weiguo Li
2022-03-11 19:08 ` Davidlohr Bueso
2022-03-12 13:49   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.