summaryrefslogtreecommitdiffstats
path: root/drivers/video/intelfb/intelfbdrv.c
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2005-12-19 08:11:40 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-20 18:27:15 +0100
commit4b3760ce3d448d4af3036cd6c650d651a16ee02d (patch)
tree369f5680fad714f215f7b96b7b62975d55c55424 /drivers/video/intelfb/intelfbdrv.c
parent[PATCH] powerpc: g5 thermal overtemp bug (diff)
downloadlinux-4b3760ce3d448d4af3036cd6c650d651a16ee02d.tar.xz
linux-4b3760ce3d448d4af3036cd6c650d651a16ee02d.zip
[PATCH] intelfb: Fix freeing of nonexistent resource
Fix intelfb trying to free a non-existent resource in its error path. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r--drivers/video/intelfb/intelfbdrv.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 427689e584da..ac8d6617095e 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -473,9 +473,9 @@ cleanup(struct intelfb_info *dinfo)
if (dinfo->aperture.virtual)
iounmap((void __iomem *)dinfo->aperture.virtual);
- if (dinfo->mmio_base_phys)
+ if (dinfo->flag & INTELFB_MMIO_ACQUIRED)
release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE);
- if (dinfo->aperture.physical)
+ if (dinfo->flag & INTELFB_FB_ACQUIRED)
release_mem_region(dinfo->aperture.physical,
dinfo->aperture.size);
framebuffer_release(dinfo->info);
@@ -572,6 +572,9 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
cleanup(dinfo);
return -ENODEV;
}
+
+ dinfo->flag |= INTELFB_FB_ACQUIRED;
+
if (!request_mem_region(dinfo->mmio_base_phys,
INTEL_REG_SIZE,
INTELFB_MODULE_NAME)) {
@@ -580,6 +583,8 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
return -ENODEV;
}
+ dinfo->flag |= INTELFB_MMIO_ACQUIRED;
+
/* Get the chipset info. */
dinfo->pci_chipset = pdev->device;