We did a null check after "epollfdp = calloc(...)", but we checked
"epollfd" instead of "epollfdp".
Signed-off-by: Weiguo Li <[email protected]>
---
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
On Fri, 11 Mar 2022, Weiguo Li wrote:
>We did a null check after "epollfdp = calloc(...)", but we checked
>"epollfd" instead of "epollfdp".
>
>Signed-off-by: Weiguo Li <[email protected]>
Acked-by: Davidlohr Bueso <[email protected]>
Em Fri, Mar 11, 2022 at 11:08:56AM -0800, Davidlohr Bueso escreveu:
> On Fri, 11 Mar 2022, Weiguo Li wrote:
>
> > We did a null check after "epollfdp = calloc(...)", but we checked
> > "epollfd" instead of "epollfdp".
> >
> > Signed-off-by: Weiguo Li <[email protected]>
>
> Acked-by: Davidlohr Bueso <[email protected]>
Thanks, applied.
- Arnaldo