diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2005-12-19 02:11:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-20 12:27:15 -0500 |
commit | 4b3760ce3d448d4af3036cd6c650d651a16ee02d (patch) | |
tree | 369f5680fad714f215f7b96b7b62975d55c55424 /drivers/video/intelfb/intelfbdrv.c | |
parent | 6ee7fb7e363aa8828b3920422416707c79f39007 (diff) |
[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 'drivers/video/intelfb/intelfbdrv.c')
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 9 |
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) | |||
473 | if (dinfo->aperture.virtual) | 473 | if (dinfo->aperture.virtual) |
474 | iounmap((void __iomem *)dinfo->aperture.virtual); | 474 | iounmap((void __iomem *)dinfo->aperture.virtual); |
475 | 475 | ||
476 | if (dinfo->mmio_base_phys) | 476 | if (dinfo->flag & INTELFB_MMIO_ACQUIRED) |
477 | release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE); | 477 | release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE); |
478 | if (dinfo->aperture.physical) | 478 | if (dinfo->flag & INTELFB_FB_ACQUIRED) |
479 | release_mem_region(dinfo->aperture.physical, | 479 | release_mem_region(dinfo->aperture.physical, |
480 | dinfo->aperture.size); | 480 | dinfo->aperture.size); |
481 | framebuffer_release(dinfo->info); | 481 | framebuffer_release(dinfo->info); |
@@ -572,6 +572,9 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
572 | cleanup(dinfo); | 572 | cleanup(dinfo); |
573 | return -ENODEV; | 573 | return -ENODEV; |
574 | } | 574 | } |
575 | |||
576 | dinfo->flag |= INTELFB_FB_ACQUIRED; | ||
577 | |||
575 | if (!request_mem_region(dinfo->mmio_base_phys, | 578 | if (!request_mem_region(dinfo->mmio_base_phys, |
576 | INTEL_REG_SIZE, | 579 | INTEL_REG_SIZE, |
577 | INTELFB_MODULE_NAME)) { | 580 | INTELFB_MODULE_NAME)) { |
@@ -580,6 +583,8 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
580 | return -ENODEV; | 583 | return -ENODEV; |
581 | } | 584 | } |
582 | 585 | ||
586 | dinfo->flag |= INTELFB_MMIO_ACQUIRED; | ||
587 | |||
583 | /* Get the chipset info. */ | 588 | /* Get the chipset info. */ |
584 | dinfo->pci_chipset = pdev->device; | 589 | dinfo->pci_chipset = pdev->device; |
585 | 590 | ||