summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2006-03-15 20:21:23 +0000
committerAdam Jackson <ajax@nwnk.net>2006-03-15 20:21:23 +0000
commit089c7be83d6cace94a692ec46a4c3a05b32fd4f4 (patch)
tree95d3290ba12fb19318162d2c75842b0f03eb30b9
parent20eb3f159fe3629d1bfb6b9437912f55b690e068 (diff)
Coverity #1009: Check for NULL first before assigning to pMGADRI.
-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