diff options
author | Amol Lad <amol@verismonetworks.com> | 2006-12-08 13:40:13 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 19:29:05 +0300 |
commit | d8b8c0a697d60c7d58a3dbda2d78553fd27727b3 (patch) | |
tree | 3a9261c962c65bf2cea064daf5e2bf06df659e9a /drivers/video/cirrusfb.c | |
parent | d02abed8aa6bd37abcd802de64a63ed2af5e18ff (diff) | |
download | linux-d8b8c0a697d60c7d58a3dbda2d78553fd27727b3.tar.xz |
[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: 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/cirrusfb.c')
-rw-r--r-- | drivers/video/cirrusfb.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index daf43f535a0b..2c4bc6205738 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c @@ -2442,7 +2442,10 @@ static int cirrusfb_pci_register (struct pci_dev *pdev, printk ("Cirrus Logic chipset on PCI bus\n"); pci_set_drvdata(pdev, info); - return cirrusfb_register(cinfo); + ret = cirrusfb_register(cinfo); + if (ret) + iounmap(cinfo->fbmem); + return ret; err_release_legacy: if (release_io_ports) @@ -2574,7 +2577,15 @@ static int cirrusfb_zorro_register(struct zorro_dev *z, printk (KERN_INFO "Cirrus Logic chipset on Zorro bus\n"); 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: /* Parental advisory: explicit hack */ |