summaryrefslogtreecommitdiffstats
path: root/drivers/video/pvr2fb.c
diff options
context:
space:
mode:
authorAmol Lad <amol@verismonetworks.com>2006-12-08 02:40:06 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 08:29:04 -0800
commit295a1b476749e8b6fa6c3c0978426360ac7dde4b (patch)
treea70846427824ebddedb545298f8e7c13824e52f3 /drivers/video/pvr2fb.c
parent027b53dd92e3d1a23c56d85e006a9bb5e63314f9 (diff)
downloadlinux-295a1b476749e8b6fa6c3c0978426360ac7dde4b.tar.bz2
[PATCH] ioremap balanced with iounmap for drivers/video/pvr2fb
ioremap must be balanced by an iounmap and failing to do so can result in a memory leak. Signed-off-by: Amol Lad <amol@verismonetworks.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/pvr2fb.c')
-rw-r--r--drivers/video/pvr2fb.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index c7bc80921f16..a93618bc9d27 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -905,6 +905,15 @@ static int __init pvr2fb_dc_init(void)
static void pvr2fb_dc_exit(void)
{
+ if (fb_info->screen_base) {
+ iounmap(fb_info->screen_base);
+ fb_info->screen_base = NULL;
+ }
+ if (currentpar->mmio_base) {
+ iounmap((void *)currentpar->mmio_base);
+ currentpar->mmio_base = 0;
+ }
+
free_irq(HW_EVENT_VSYNC, 0);
#ifdef CONFIG_SH_DMA
free_dma(pvr2dma);
@@ -946,6 +955,15 @@ static int __devinit pvr2fb_pci_probe(struct pci_dev *pdev,
static void __devexit pvr2fb_pci_remove(struct pci_dev *pdev)
{
+ if (fb_info->screen_base) {
+ iounmap(fb_info->screen_base);
+ fb_info->screen_base = NULL;
+ }
+ if (currentpar->mmio_base) {
+ iounmap((void *)currentpar->mmio_base);
+ currentpar->mmio_base = 0;
+ }
+
pci_release_regions(pdev);
}