Commit 164a765b authored by Amol Lad's avatar Amol Lad Committed by Linus Torvalds

[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: default avatarAmol Lad <amol@verismonetworks.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f190017b
...@@ -608,6 +608,22 @@ void __init macfb_setup(char *options) ...@@ -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) static int __init macfb_init(void)
{ {
int video_cmap_len, video_is_nubus = 0; int video_cmap_len, video_is_nubus = 0;
...@@ -962,6 +978,10 @@ static int __init macfb_init(void) ...@@ -962,6 +978,10 @@ static int __init macfb_init(void)
if (!err) if (!err)
printk("fb%d: %s frame buffer device\n", printk("fb%d: %s frame buffer device\n",
fb_info.node, fb_info.fix.id); fb_info.node, fb_info.fix.id);
else {
iounmap(fb_info.screen_base);
iounmap_macfb();
}
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment