From 0ca3acb9dc121da57641b3c13614ce3e2d71ab2c Mon Sep 17 00:00:00 2001 From: Gary Date: Thu, 18 Oct 2018 15:34:01 -0700 Subject: [PATCH] Fix an error test on the result of mmap syscall The Macro IS_ERR should not be used to test the result value of address type. --- Pal/src/security/Linux/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pal/src/security/Linux/main.c b/Pal/src/security/Linux/main.c index 8dc70df6..95bd224b 100644 --- a/Pal/src/security/Linux/main.c +++ b/Pal/src/security/Linux/main.c @@ -300,7 +300,7 @@ static int load_static (const char * filename, void ** load_addr, base = INLINE_SYSCALL(mmap, 6, NULL, maplength, c->prot, MAP_PRIVATE | MAP_FILE, fd, c->mapoff); - if (IS_ERR(base)) { + if (IS_ERR_P(base)) { ret = -ERRNO_P(base); goto out; }