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

[PATCH] ioremap balanced with iounmap for drivers/video/cirrusfb

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>
上级 d02abed8
...@@ -2442,7 +2442,10 @@ static int cirrusfb_pci_register (struct pci_dev *pdev, ...@@ -2442,7 +2442,10 @@ static int cirrusfb_pci_register (struct pci_dev *pdev,
printk ("Cirrus Logic chipset on PCI bus\n"); printk ("Cirrus Logic chipset on PCI bus\n");
pci_set_drvdata(pdev, info); pci_set_drvdata(pdev, info);
return cirrusfb_register(cinfo); ret = cirrusfb_register(cinfo);
if (ret)
iounmap(cinfo->fbmem);
return ret;
err_release_legacy: err_release_legacy:
if (release_io_ports) if (release_io_ports)
...@@ -2574,7 +2577,15 @@ static int cirrusfb_zorro_register(struct zorro_dev *z, ...@@ -2574,7 +2577,15 @@ static int cirrusfb_zorro_register(struct zorro_dev *z,
printk (KERN_INFO "Cirrus Logic chipset on Zorro bus\n"); printk (KERN_INFO "Cirrus Logic chipset on Zorro bus\n");
zorro_set_drvdata(z, info); zorro_set_drvdata(z, info);
return cirrusfb_register(cinfo); ret = cirrusfb_register(cinfo);
if (ret) {
if (btype == BT_PICASSO4) {
iounmap(cinfo->fbmem);
iounmap(cinfo->regbase - 0x600000);
} else if (board_addr > 0x01000000)
iounmap(cinfo->fbmem);
}
return ret;
err_unmap_regbase: err_unmap_regbase:
/* Parental advisory: explicit hack */ /* Parental advisory: explicit hack */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册