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

[Xen-changelog] [xen master] libxl_internal.c: Fix return handling for case of mmap failure



commit 8a14ca08f2aa5e52ffd8b42792ae1f3a708339ee
Author:     Don Slutz <dslutz@xxxxxxxxxxx>
AuthorDate: Mon Jul 28 12:06:01 2014 -0400
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Wed Jul 30 12:42:17 2014 +0100

    libxl_internal.c: Fix return handling for case of mmap failure
    
    mmap() returns MAP_FAILED not NULL.
    
    Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/libxl_internal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index 81f8985..b880c89 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -246,7 +246,7 @@ int libxl__file_reference_map(libxl__file_reference *f)
 
     ret = -1;
     data = mmap(NULL, st_buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
-    if (data == NULL)
+    if (data == MAP_FAILED)
         goto out;
 
     f->mapped = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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