[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 4/4] xenbaked.c: Fix return handling for case of mmap failure



mmap() returns MAP_FAILED not NULL.

Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx>
---
 tools/xenmon/xenbaked.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenmon/xenbaked.c b/tools/xenmon/xenbaked.c
index 985f1dd..dc61d14 100644
--- a/tools/xenmon/xenbaked.c
+++ b/tools/xenmon/xenbaked.c
@@ -674,7 +674,7 @@ static void alloc_qos_data(int ncpu)
         new_qos = (_new_qos_data *) mmap(0, sizeof(_new_qos_data), 
PROT_READ|PROT_WRITE, 
                                          MAP_SHARED, qos_fd, off);
         off += i;
-        if (new_qos == NULL) {
+        if (new_qos == MAP_FAILED) {
             PERROR("mmap");
             exit(3);
         }
-- 
1.8.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.