From 314eecb6628840a942ff2e76d8c7402301feac77 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Fri, 26 Sep 2008 19:30:17 -0300 Subject: Properly check pScrn->driverPrivate before deferencing it. Add missing divide by 1000 in smi_501.c, as well as a FIXME comment about a crash, and possible cause as well as possible ways to program other clocks. --- src/smi_driver.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/smi_driver.c') diff --git a/src/smi_driver.c b/src/smi_driver.c index 507e6c7..a1e5dc4 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -418,19 +418,11 @@ SMI_FreeRec(ScrnInfoPtr pScrn) ENTER(); - if (pScrn->driverPrivate != NULL) { - xfree(pScrn->driverPrivate); - pScrn->driverPrivate = NULL; - } - - if (pSmi->save) { + if (pSmi) { xfree(pSmi->save); - pSmi->save = NULL; - } - - if (pSmi->mode) { xfree(pSmi->mode); - pSmi->mode = NULL; + xfree(pScrn->driverPrivate); + pScrn->driverPrivate = NULL; } LEAVE(); @@ -1054,7 +1046,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) clockRanges->clockIndex = -1; clockRanges->interlaceAllowed = FALSE; clockRanges->doubleScanAllowed = FALSE; - + i = xf86ValidateModes( pScrn, /* Screen pointer */ pScrn->monitor->Modes, /* Available monitor modes */ -- cgit v1.2.3