Skip to content

Commit

Permalink
[PATCH] ioremap balanced with iounmap for drivers/video/amifb
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>
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 6792951 commit 57354c4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/video/amifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2407,10 +2407,10 @@ int __init amifb_init(void)
fb_info.fix.smem_len);
if (!videomemory) {
printk("amifb: WARNING! unable to map videomem cached writethrough\n");
videomemory = ZTWO_VADDR(fb_info.fix.smem_start);
}
fb_info.screen_base = (char *)ZTWO_VADDR(fb_info.fix.smem_start);
} else
fb_info.screen_base = (char *)videomemory;

fb_info.screen_base = (char *)videomemory;
memset(dummysprite, 0, DUMMYSPRITEMEMSIZE);

/*
Expand Down Expand Up @@ -2453,6 +2453,8 @@ static void amifb_deinit(void)
{
fb_dealloc_cmap(&fb_info.cmap);
chipfree();
if (videomemory)
iounmap((void*)videomemory);
release_mem_region(CUSTOM_PHYSADDR+0xe0, 0x120);
custom.dmacon = DMAF_ALL | DMAF_MASTER;
}
Expand Down

0 comments on commit 57354c4

Please sign in to comment.