dri_util: fail driCreateNewScreen if InitScreen is NULL
authorPaulo Zanoni <pzanoni@mandriva.com>
Thu, 13 Jan 2011 12:59:12 +0000 (04:59 -0800)
committerBrian Paul <brianp@vmware.com>
Thu, 13 Jan 2011 14:44:33 +0000 (07:44 -0700)
Without this, X doesn't start with UMS on r300g.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Paulo Zanoni <pzanoni@mandriva.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/dri/common/dri_util.c

index a5b71bd40adb51c683b65a1fefa9e6acfd99c17f..bf8cf6eec07e312529346b5a6790293d33771943 100644 (file)
@@ -790,6 +790,9 @@ driCreateNewScreen(int scrn,
     static const __DRIextension *emptyExtensionList[] = { NULL };
     __DRIscreen *psp;
 
+    if (driDriverAPI.InitScreen == NULL)
+       return NULL;
+
     psp = calloc(1, sizeof *psp);
     if (!psp)
        return NULL;