Commit 9cf2014a authored by Amol Lad's avatar Amol Lad Committed by Linus Torvalds

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

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: Helge Deller <deller@parisc-linux.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e4bf051b
...@@ -1291,6 +1291,7 @@ out_err3: ...@@ -1291,6 +1291,7 @@ out_err3:
out_err2: out_err2:
release_mem_region(fix->smem_start, fix->smem_len); release_mem_region(fix->smem_start, fix->smem_len);
out_err1: out_err1:
iounmap(info->screen_base);
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
out_err0: out_err0:
kfree(fb); kfree(fb);
...@@ -1364,6 +1365,8 @@ stifb_cleanup(void) ...@@ -1364,6 +1365,8 @@ stifb_cleanup(void)
unregister_framebuffer(sti->info); unregister_framebuffer(sti->info);
release_mem_region(info->fix.mmio_start, info->fix.mmio_len); release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
release_mem_region(info->fix.smem_start, info->fix.smem_len); release_mem_region(info->fix.smem_start, info->fix.smem_len);
if (info->screen_base)
iounmap(info->screen_base);
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
kfree(info); kfree(info);
} }
......
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