[CRIU] [PATCH] uffd: typo fix
Andrey Vagin
avagin at openvz.org
Fri May 13 14:42:56 PDT 2016
From: Andrew Vagin <avagin at virtuozzo.com>
>>> CID 161316: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "events" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
criu/uffd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/criu/uffd.c b/criu/uffd.c
index 97779fd..cb7d0cb 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -765,7 +765,7 @@ static int prepare_epoll(int nr_fds, struct epoll_event **events)
int epollfd;
*events = malloc(sizeof(struct epoll_event) * nr_fds);
- if (!events) {
+ if (!*events) {
pr_err("memory allocation failed\n");
return -1;
}
--
2.7.4
More information about the CRIU
mailing list