summaryrefslogtreecommitdiff
path: root/src/smi_driver.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-09-26 19:30:17 -0300
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-09-26 19:30:17 -0300
commit314eecb6628840a942ff2e76d8c7402301feac77 (patch)
tree93cb70d5fc5bd91ed2baec8672f10ae2699068b3 /src/smi_driver.c
parentf18222ffcff8e78b3cfcd220cad06a1daa3fc920 (diff)
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.
Diffstat (limited to 'src/smi_driver.c')
-rw-r--r--src/smi_driver.c16
1 files changed, 4 insertions, 12 deletions
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 */