Skip to content

Commit

Permalink
[PATCH] ioremap balanced with iounmap for drivers/video/ffb
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 <[email protected]>
Cc: "Antonino A. Daplas" <[email protected]>
Cc: David S. Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Amol Lad authored and Linus Torvalds committed Dec 8, 2006
1 parent 1b3349f commit 8d4c767
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/video/ffb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 8d4c767

Please sign in to comment.