提交 295a1b47 编写于 作者: A Amol Lad 提交者: Linus Torvalds

[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: NAmol Lad <amol@verismonetworks.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 027b53dd
...@@ -905,6 +905,15 @@ static int __init pvr2fb_dc_init(void) ...@@ -905,6 +905,15 @@ static int __init pvr2fb_dc_init(void)
static void pvr2fb_dc_exit(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); free_irq(HW_EVENT_VSYNC, 0);
#ifdef CONFIG_SH_DMA #ifdef CONFIG_SH_DMA
free_dma(pvr2dma); free_dma(pvr2dma);
...@@ -946,6 +955,15 @@ static int __devinit pvr2fb_pci_probe(struct pci_dev *pdev, ...@@ -946,6 +955,15 @@ static int __devinit pvr2fb_pci_probe(struct pci_dev *pdev,
static void __devexit pvr2fb_pci_remove(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); pci_release_regions(pdev);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册