From 8d4c767ef56473b68a601274612d604c8c334dc9 Mon Sep 17 00:00:00 2001 From: Amol Lad Date: Fri, 8 Dec 2006 02:40:12 -0800 Subject: [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 --- drivers/video/ffb.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c index 2a0e8210d398..949141bd44d4 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; } -- cgit v1.2.2