From 57354c42f177a2b58fb1f61125ad2cb2e8743a9b Mon Sep 17 00:00:00 2001 From: Amol Lad Date: Fri, 8 Dec 2006 02:40:16 -0800 Subject: [PATCH] ioremap balanced with iounmap for drivers/video/amifb ioremap must be balanced by an iounmap and failing to do so can result in a memory leak. Signed-off-by: Amol Lad Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/amifb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/video/amifb.c') diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index a4e3fca..88a4784 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -2407,10 +2407,10 @@ default_chipset: 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); /* @@ -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; } -- cgit v1.1