Mesa (master): selinux: Fix mmap() return value check

Adam Jackson ajax at kemper.freedesktop.org
Mon Sep 21 21:04:40 UTC 2009


Module: Mesa
Branch: master
Commit: 83019ffc0708708af7ee1ddbf3cbf949bcf076bd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=83019ffc0708708af7ee1ddbf3cbf949bcf076bd

Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Sep 21 17:03:58 2009 -0400

selinux: Fix mmap() return value check

---

 src/mesa/main/execmem.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c
index 57c1e11..4c61399 100644
--- a/src/mesa/main/execmem.c
+++ b/src/mesa/main/execmem.c
@@ -80,11 +80,10 @@ init_heap(void)
       exec_heap = mmInit( 0, EXEC_HEAP_SIZE );
    
    if (!exec_mem)
-      exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, 
-					PROT_EXEC | PROT_READ | PROT_WRITE, 
-					MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+      exec_mem = mmap(NULL, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE,
+		      MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 
-   return (exec_mem != NULL);
+   return (exec_mem != MAP_FAILED);
 }
 
 




More information about the mesa-commit mailing list