summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAmol Lad <amol@verismonetworks.com>2006-12-08 11:40:09 +0100
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 17:29:04 +0100
commit164a765b9895f4f80f91cb7f1aab7539b3f8d335 (patch)
tree3bf84420e5dbce010f93f675995f5d23924dc5d8 /drivers/video
parent[PATCH] ioremap balanced with iounmap for drivers/video/offb (diff)
downloadlinux-164a765b9895f4f80f91cb7f1aab7539b3f8d335.tar.xz
linux-164a765b9895f4f80f91cb7f1aab7539b3f8d335.zip
[PATCH] ioremap balanced with iounmap for drivers/video/macfb
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> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/macfb.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c
index 80a043807161..180d94c2b4d2 100644
--- a/drivers/video/macfb.c
+++ b/drivers/video/macfb.c
@@ -608,6 +608,22 @@ void __init macfb_setup(char *options)
}
}
+static void __init iounmap_macfb(void)
+{
+ if (valkyrie_cmap_regs)
+ iounmap(valkyrie_cmap_regs);
+ if (dafb_cmap_regs)
+ iounmap(dafb_cmap_regs);
+ if (v8_brazil_cmap_regs)
+ iounmap(v8_brazil_cmap_regs);
+ if (rbv_cmap_regs)
+ iounmap(rbv_cmap_regs);
+ if (civic_cmap_regs)
+ iounmap(civic_cmap_regs);
+ if (csc_cmap_regs)
+ iounmap(csc_cmap_regs);
+}
+
static int __init macfb_init(void)
{
int video_cmap_len, video_is_nubus = 0;
@@ -962,6 +978,10 @@ static int __init macfb_init(void)
if (!err)
printk("fb%d: %s frame buffer device\n",
fb_info.node, fb_info.fix.id);
+ else {
+ iounmap(fb_info.screen_base);
+ iounmap_macfb();
+ }
return err;
}