[PATCH] linux: Propagate failure up to xf86MapVidMem (#18304)

Adam Jackson ajax at redhat.com
Thu Apr 10 07:52:56 PDT 2014


As opposed to calling FatalError.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/os-support/linux/lnx_video.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 47f5abc..6a7c85f 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -437,8 +437,9 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
     fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
 #endif
     if (fd < 0) {
-        FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
+        xf86ErrorF("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
                    strerror(errno));
+        return MAP_FAILED;
     }
 
     if (flags & VIDMEM_READONLY)
@@ -451,8 +452,9 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
                 (off_t) realBase + BUS_BASE);
     close(fd);
     if (base == MAP_FAILED) {
-        FatalError("xf86MapVidMem: Could not mmap framebuffer"
+        xf86ErrorF("xf86MapVidMem: Could not mmap framebuffer"
                    " (0x%08lx,0x%lx) (%s)\n", Base, Size, strerror(errno));
+        return MAP_FAILED;
     }
     DebugF("base: %lx aligned base: %lx\n", base, (char *) base + alignOff);
     return (char *) base + alignOff;
-- 
1.8.5.3



More information about the xorg-devel mailing list