From patchwork Fri Jul 31 09:22:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Kessler X-Patchwork-Id: 38489 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6V9MUSq030801 for ; Fri, 31 Jul 2009 09:22:30 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2F349E758; Fri, 31 Jul 2009 02:22:29 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by gabe.freedesktop.org (Postfix) with SMTP id 2FB469E733 for ; Fri, 31 Jul 2009 02:22:26 -0700 (PDT) Received: (qmail invoked by alias); 31 Jul 2009 09:22:25 -0000 Received: from cpc1-cbly4-0-0-cust824.glfd.cable.ntl.com (EHLO mail-client) [86.0.247.57] by mail.gmx.net (mp069) with SMTP; 31 Jul 2009 11:22:25 +0200 X-Authenticated: #3441593 X-Provags-ID: V01U2FsdGVkX18q/g44pJoqypFhD/X7/KSe8I4P+6/PyTmVcpy0y3 MjHikqT1fW03TN From: Magnus Kessler To: intel-gfx@lists.freedesktop.org Date: Fri, 31 Jul 2009 10:22:16 +0100 User-Agent: KMail MIME-Version: 1.0 Message-Id: <200907311022.21977.Magnus.Kessler@gmx.net> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.68 Subject: [Intel-gfx] PATCH: do not crash in i830_allocate_memory_bo if pI830->bufmgr is NULL X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org 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 From a86fb8cade19d899b67fd59b9c5fe6f255e0b078 Mon Sep 17 00:00:00 2001 From: Magnus Kessler 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