From c889b34e432198d5410a068eff3089ff5314ac27 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 7 Jul 2009 18:05:01 +0100 Subject: Check for a valid I830Ptr before closing master. After failing to become DRM master, the X server dies attempting to close the master fd during free: (EE) intel(0): [drm] failed to set drm interface version. (EE) intel(0): Failed to become DRM master. (EE) intel(0): failed to get resources: Bad file descriptor (EE) intel(0): Kernel modesetting setup failed Backtrace: 0: X(xorg_backtrace+0x3b) [0x8133a3b] 1: X(xf86SigHandler+0x55) [0x80c7945] 2: [0xb805d400] 3: /usr/lib/xorg/modules/drivers//intel_drv.so [0xb7b4bfcc] 4: X(xf86DeleteScreen+0x6b) [0x80d465b] 5: X(InitOutput+0x548) [0x80b0158] 6: X(main+0x1cb) [0x807220b] 7: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7d107a5] 8: X [0x8071881] Saw signal 11. Server aborting. ddxSigGiveUp: Closing log ddxSigGiveUp: re-raising 11 Segmentation fault Signed-off-by: Chris Wilson --- src/i830_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i830_driver.c b/src/i830_driver.c index c125a73e..d1acaa56 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -1482,7 +1482,7 @@ static void i830_close_drm_master(ScrnInfoPtr scrn) { I830Ptr i830 = I830PTR(scrn); - if (i830->drmSubFD > 0) { + if (i830 && i830->drmSubFD > 0) { drmClose(i830->drmSubFD); i830->drmSubFD = -1; } -- cgit v1.2.3