File xf86-video-nv-commit-e6b0463.diff of Package xorg-x11-driver-video

commit e6b046329480a26ecebadf4314673db3f107f83e
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Mon Mar 8 16:49:24 2010 -0800

    Bug #24787: Don't crash if LVDS initialization fails
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>

Index: xf86-video-nv-2.1.17/src/g80_output.c
===================================================================
--- xf86-video-nv-2.1.17.orig/src/g80_output.c
+++ xf86-video-nv-2.1.17/src/g80_output.c
@@ -481,19 +481,22 @@ G80CreateOutputs(ScrnInfoPtr pScrn)
 
     if(pNv->lvds.present) {
         xf86OutputPtr lvds = G80CreateSor(pScrn, pNv->lvds.or, LVDS);
-        G80OutputPrivPtr pPriv = lvds->driver_private;
 
-        pPriv->scale = G80_SCALE_ASPECT;
+        if (lvds) {
+            G80OutputPrivPtr pPriv = lvds->driver_private;
 
-        if(pNv->lvds.i2cPort != -1) {
-            char i2cName[16];
+            pPriv->scale = G80_SCALE_ASPECT;
 
-            snprintf(i2cName, sizeof(i2cName), "I2C%i (LVDS)", pNv->lvds.i2cPort);
-            pPriv->i2c = G80I2CInit(pScrn, i2cName, pNv->lvds.i2cPort);
-            if(!pPriv->i2c) {
-                xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                           "Failed to initialize I2C for port %i (LVDS)!\n",
-                           pNv->lvds.i2cPort);
+            if(pNv->lvds.i2cPort != -1) {
+                char i2cName[16];
+
+                snprintf(i2cName, sizeof(i2cName), "I2C%i (LVDS)", pNv->lvds.i2cPort);
+                pPriv->i2c = G80I2CInit(pScrn, i2cName, pNv->lvds.i2cPort);
+                if(!pPriv->i2c) {
+                    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                               "Failed to initialize I2C for port %i (LVDS)!\n",
+                               pNv->lvds.i2cPort);
+                }
             }
         }
     }
openSUSE Build Service is sponsored by