summaryrefslogtreecommitdiff
path: root/src/smi_driver.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-09-22 14:25:04 -0300
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-09-22 14:25:04 -0300
commitcf7097c19b31671a53bc8161bd29b9f79f1d3d85 (patch)
tree476e416c21e2405f0bc5455e3b72a1c593ed4eb9 /src/smi_driver.c
parentee1e72a248b2df6522283c0dd3e5433d7f961c62 (diff)
Fix a leak and minor cosmetic change.
Leak was due to only releasing return value of xf86GetEntityInfo if the chipset was PCI_CHIP_SMI501. Cosmetic change was to log pci burst and pci retry default values as X_DEFAULT instead of X_PROBED.
Diffstat (limited to 'src/smi_driver.c')
-rw-r--r--src/smi_driver.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/smi_driver.c b/src/smi_driver.c
index dfa07be..c32e248 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -508,16 +508,17 @@ SMI_Probe(DriverPtr drv, int flags)
pScrn->SwitchMode = SMI_SwitchMode;
pScrn->AdjustFrame = SMI_AdjustFrame;
- if ((pEnt = xf86GetEntityInfo(usedChips[i])) &&
- pEnt->chipset == PCI_CHIP_SMI501) {
- pScrn->EnterVT = SMI501_EnterVT;
- pScrn->LeaveVT = SMI501_LeaveVT;
+ if ((pEnt = xf86GetEntityInfo(usedChips[i]))) {
+ if (pEnt->chipset == PCI_CHIP_SMI501) {
+ pScrn->EnterVT = SMI501_EnterVT;
+ pScrn->LeaveVT = SMI501_LeaveVT;
+ }
+ else {
+ pScrn->EnterVT = SMI_EnterVT;
+ pScrn->LeaveVT = SMI_LeaveVT;
+ }
xfree(pEnt);
}
- else {
- pScrn->EnterVT = SMI_EnterVT;
- pScrn->LeaveVT = SMI_LeaveVT;
- }
pScrn->FreeScreen = SMI_FreeScreen;
pScrn->ValidMode = SMI_ValidMode;
foundScreen = TRUE;
@@ -685,7 +686,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSmi->Options);
/* Enable pci burst by default */
- from = X_PROBED;
+ from = X_DEFAULT;
pSmi->PCIBurst = TRUE;
if (xf86GetOptValBool(pSmi->Options, OPTION_PCI_BURST, &pSmi->PCIBurst))
from = X_CONFIG;
@@ -693,7 +694,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->PCIBurst ? "en" : "dis");
/* Pci retry enabled by default if pci burst also enabled */
- from = X_PROBED;
+ from = X_DEFAULT;
pSmi->PCIRetry = pSmi->PCIBurst ? TRUE : FALSE;
if (xf86GetOptValBool(pSmi->Options, OPTION_PCI_RETRY, &pSmi->PCIRetry)) {
from = X_CONFIG;