diff mbox

PATCH: do not crash in i830_allocate_memory_bo if pI830->bufmgr is NULL

Message ID 200907311022.21977.Magnus.Kessler@gmx.net (mailing list archive)
State Not Applicable
Headers show

Commit Message

Magnus Kessler July 31, 2009, 9:22 a.m. UTC
With current git master of xserver and xf86-video-intel I encounter a crash in 
i830_allocate_memory_bo (i830_memory.c:730) when the server is restarted by 
kdm.

The attached patch avoids the crash by guarding against a NULL pointer to 
pI830->bufmgr.

I suspect however that the real fix has probably to do with a missing re-
initialisation of the bufmgr on server restart. Any tips where to look for 
this are welcome.

Magnus

Comments

Magnus Kessler July 31, 2009, 9:45 a.m. UTC | #1
On Friday 31 Jul 2009 10:22:16 Magnus Kessler wrote:
> With current git master of xserver and xf86-video-intel I encounter a crash
> in i830_allocate_memory_bo (i830_memory.c:730) when the server is restarted
> by kdm.

That should have read: crash in dri_bo_alloc, called from 
i830_allocate_memory_bo.

>
> The attached patch avoids the crash by guarding against a NULL pointer to
> pI830->bufmgr.
>
> I suspect however that the real fix has probably to do with a missing re-
> initialisation of the bufmgr on server restart. Any tips where to look for
> this are welcome.
>
> Magnus
diff mbox

Patch

From a86fb8cade19d899b67fd59b9c5fe6f255e0b078 Mon Sep 17 00:00:00 2001
From: Magnus Kessler <Magnus.Kessler@gmx.net>
Date: Fri, 31 Jul 2009 10:11:13 +0100
Subject: [PATCH] i830_memory.c: Guard against NULL pI830->bufmgr

---
 src/i830_memory.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/i830_memory.c b/src/i830_memory.c
index d3c9299..65e7773 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -727,7 +727,8 @@  i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name,
 	return NULL;
     }
 
-    mem->bo = dri_bo_alloc (pI830->bufmgr, name, size, align);
+    if (pI830->bufmgr)
+	mem->bo = dri_bo_alloc (pI830->bufmgr, name, size, align);
 
     if (!mem->bo) {
 	xfree(mem->name);
-- 
1.6.3.3