Skip to content

Commit 073a15c

Browse files
liwg06acmel
authored andcommitted
perf bench: Fix NULL check against wrong variable
We did a NULL check after "epollfdp = calloc(...)", but we checked "epollfd" instead of "epollfdp". Signed-off-by: Weiguo Li <liwg06@foxmail.com> Acked-by: Davidlohr Bueso <dave@stgolabs.net> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Davidlohr Bueso <dbueso@suse.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/tencent_B5D64530EB9C7DBB8D2C88A0C790F1489D0A@qq.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent a7a7263 commit 073a15c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/perf/bench/epoll-ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static void nest_epollfd(void)
106106
printinfo("Nesting level(s): %d\n", nested);
107107

108108
epollfdp = calloc(nested, sizeof(int));
109-
if (!epollfd)
109+
if (!epollfdp)
110110
err(EXIT_FAILURE, "calloc");
111111

112112
for (i = 0; i < nested; i++) {

0 commit comments

Comments
 (0)