[Openchrome-devel] xf86-video-openchrome: src/via_driver.c
James Simmons
jsimmons at kemper.freedesktop.org
Sun Dec 2 12:42:28 PST 2012
src/via_driver.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 91ad6eac6362b74c24c626832697f097a7698aa8
Author: James Simmons <jsimmons at infradead.org>
Date: Sun Dec 2 15:42:17 2012 -0500
Fix a double free when exiting the xorg server
diff --git a/src/via_driver.c b/src/via_driver.c
index cacdbd3..898b649 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -418,8 +418,13 @@ VIAFreeRec(ScrnInfoPtr pScrn)
VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
- if (pBIOSInfo)
+ if (pBIOSInfo->TVI2CDev)
+ xf86DestroyI2CDevRec(pBIOSInfo->TVI2CDev, TRUE);
+
+ if (pBIOSInfo) {
+ pVia->pBIOSInfo = NULL;
free(pBIOSInfo);
+ }
if (VIAPTR(pScrn)->pVbe)
vbeFree(VIAPTR(pScrn)->pVbe);
@@ -427,10 +432,6 @@ VIAFreeRec(ScrnInfoPtr pScrn)
if (pVia->VideoRegs)
free(pVia->VideoRegs);
- if (((VIARec *) (pScrn->driverPrivate))->pBIOSInfo->TVI2CDev)
- xf86DestroyI2CDevRec((((VIARec *) (pScrn->driverPrivate))->pBIOSInfo->TVI2CDev), TRUE);
- free(((VIARec *) (pScrn->driverPrivate))->pBIOSInfo);
-
VIAUnmapMem(pScrn);
free(pScrn->driverPrivate);
More information about the Openchrome-devel
mailing list