summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/mga_dri.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 87b3a33..169de2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
* src/mga_dri.c:
Coverity #92: Eliminate a dead code path.
+ Coverity #1009: Check for NULL first before assigning to pMGADRI.
2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
diff --git a/src/mga_dri.c b/src/mga_dri.c
index 46e5f98..8780160 100644
--- a/src/mga_dri.c
+++ b/src/mga_dri.c
@@ -1252,12 +1252,14 @@ Bool MGADRIFinishScreenInit( ScreenPtr pScreen )
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
MGAPtr pMga = MGAPTR(pScrn);
MGADRIServerPrivatePtr pMGADRIServer = pMga->DRIServerInfo;
- MGADRIPtr pMGADRI = (MGADRIPtr)pMga->pDRIInfo->devPrivate;
+ MGADRIPtr pMGADRI;
int i;
if ( !pMga->pDRIInfo )
return FALSE;
+ pMGADRI = (MGADRIPtr)pMga->pDRIInfo->devPrivate;
+
pMga->pDRIInfo->driverSwapMethod = DRI_HIDE_X_CONTEXT;
/* NOTE: DRIFinishScreenInit must be called before *DRIKernelInit