From: Amol Lad Date: Fri, 8 Dec 2006 10:40:12 +0000 (-0800) Subject: [PATCH] ioremap balanced with iounmap for drivers/video/ffb X-Git-Tag: v3.12-rc1~32302^2~103 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d4c767ef56473b68a601274612d604c8c334dc9;p=kernel%2Fkernel-generic.git [PATCH] ioremap balanced with iounmap for drivers/video/ffb 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" Cc: David S. Miller Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c index 2a0e821..949141b 100644 --- a/drivers/video/ffb.c +++ b/drivers/video/ffb.c @@ -968,6 +968,8 @@ static int ffb_init_one(struct of_device *op) if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { printk(KERN_ERR "ffb: Could not allocate color map.\n"); + of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(all->par.dac, sizeof(struct ffb_dac)); kfree(all); return -ENOMEM; } @@ -978,6 +980,8 @@ static int ffb_init_one(struct of_device *op) if (err < 0) { printk(KERN_ERR "ffb: Could not register framebuffer.\n"); fb_dealloc_cmap(&all->info.cmap); + of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(all->par.dac, sizeof(struct ffb_dac)); kfree(all); return err; }