mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
libxl_internal.c: Fix return handling for case of mmap failure
mmap() returns MAP_FAILED not NULL. Signed-off-by: Don Slutz <dslutz@verizon.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
822b956ef7
commit
8a14ca08f2
1 file changed
+1
-1
@@ -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;
|
||||
|
||||