diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-03-29 11:18:24 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2011-03-30 10:52:19 +0200 |
commit | b234d7d6925b480a9c4fe23e5100e6fe7e5c0eac (patch) | |
tree | cb5b6bde396979a24905238319da4093b4efcb75 /src/vmware.c | |
parent | cdb04224db69a6b3beb66c99879e20917b8b0fb2 (diff) |
vmwlegacy: Silence a number of warnings
This potentially also fixes a use of an uninitialized pointer value, which
may cause OOM or segfaults.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <daenzer@vmware.com>
Diffstat (limited to 'src/vmware.c')
-rw-r--r-- | src/vmware.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vmware.c b/src/vmware.c index e04835f..1f262e3 100644 --- a/src/vmware.c +++ b/src/vmware.c @@ -1021,6 +1021,7 @@ VMWAREMapMem(ScrnInfoPtr pScrn) #if XSERVER_LIBPCIACCESS int err; struct pci_device *const device = pVMWARE->PciInfo; + void *fbBase; #endif #if XSERVER_LIBPCIACCESS @@ -1028,14 +1029,14 @@ VMWAREMapMem(ScrnInfoPtr pScrn) pVMWARE->memPhysBase, pVMWARE->videoRam, PCI_DEV_MAP_FLAG_WRITABLE, - (void **) &pVMWARE->FbBase); + &fbBase); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map frame buffer BAR. %s (%d)\n", strerror (err), err); return FALSE; } - + pVMWARE->FbBase = fbBase; #else pVMWARE->FbBase = xf86MapPciMem(pScrn->scrnIndex, 0, pVMWARE->PciTag, @@ -1336,6 +1337,7 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn) #if XSERVER_LIBPCIACCESS struct pci_device *const device = pVMWARE->PciInfo; int err; + void *mmioVirtBase; #endif CARD32* vmwareFIFO; Bool extendedFifo; @@ -1349,13 +1351,14 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn) err = pci_device_map_range(device, pVMWARE->mmioPhysBase, pVMWARE->mmioSize, PCI_DEV_MAP_FLAG_WRITABLE, - (void **) &pVMWARE->mmioVirtBase); + &mmioVirtBase); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map mmio BAR. %s (%d)\n", strerror (err), err); return; } + pVMWARE->mmioVirtBase = mmioVirtBase; #else pVMWARE->mmioVirtBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVMWARE->PciTag, |