Skip to content

Commit

Permalink
[PATCH] ioremap balanced with iounmap for drivers/video/stifb
Browse files Browse the repository at this point in the history
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: Helge Deller <deller@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Amol Lad authored and Linus Torvalds committed Dec 8, 2006
1 parent e4bf051 commit 9cf2014
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/video/stifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,7 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref)
out_err2:
release_mem_region(fix->smem_start, fix->smem_len);
out_err1:
iounmap(info->screen_base);
fb_dealloc_cmap(&info->cmap);
out_err0:
kfree(fb);
Expand Down Expand Up @@ -1364,6 +1365,8 @@ stifb_cleanup(void)
unregister_framebuffer(sti->info);
release_mem_region(info->fix.mmio_start, info->fix.mmio_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);
kfree(info);
}
Expand Down

0 comments on commit 9cf2014

Please sign in to comment.