[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191116114114.7066-2-christian@brauner.io>
Date: Sat, 16 Nov 2019 12:41:13 +0100
From: Christian Brauner <christian@...uner.io>
To: mtk.manpages@...il.com
Cc: adrian@...as.de, akpm@...ux-foundation.org, arnd@...db.de,
avagin@...il.com, christian.brauner@...ntu.com,
dhowells@...hat.com, fweimer@...hat.com, jannh@...gle.com,
keescook@...omium.org, linux-api@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-man@...r.kernel.org,
mingo@...e.hu, oleg@...hat.com, xemul@...tuozzo.com
Subject: [PATCH 2/3] clone.2: Check for MAP_FAILED not NULL on mmap()
From: Christian Brauner <christian.brauner@...ntu.com>
If mmap() fails it will return MAP_FAILED which according to the manpage
is (void *)-1 not NULL.
Signed-off-by: Christian Brauner <christian.brauner@...ntu.com>
---
man2/clone.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man2/clone.2 b/man2/clone.2
index 57a9eaba7..faff2ada6 100644
--- a/man2/clone.2
+++ b/man2/clone.2
@@ -1628,7 +1628,7 @@ main(int argc, char *argv[])
stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, \-1, 0);
- if (stack == NULL)
+ if (stack == MAP_FAILED)
errExit("mmap");
stackTop = stack + STACK_SIZE; /* Assume stack grows downward */
--
2.24.0
Powered by blists - more mailing lists