diff options
author | Amol Lad <amol@verismonetworks.com> | 2006-12-08 05:40:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:29:04 -0500 |
commit | 8d4c767ef56473b68a601274612d604c8c334dc9 (patch) | |
tree | 7b588038b24e027e0a687eaeba99d931e3eaab2c /drivers/video | |
parent | 1b3349fa448ce41eda5ae0e6d4dc52837d14ad11 (diff) |
[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 <amol@verismonetworks.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/ffb.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) | |||
968 | 968 | ||
969 | if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { | 969 | if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { |
970 | printk(KERN_ERR "ffb: Could not allocate color map.\n"); | 970 | printk(KERN_ERR "ffb: Could not allocate color map.\n"); |
971 | of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); | ||
972 | of_iounmap(all->par.dac, sizeof(struct ffb_dac)); | ||
971 | kfree(all); | 973 | kfree(all); |
972 | return -ENOMEM; | 974 | return -ENOMEM; |
973 | } | 975 | } |
@@ -978,6 +980,8 @@ static int ffb_init_one(struct of_device *op) | |||
978 | if (err < 0) { | 980 | if (err < 0) { |
979 | printk(KERN_ERR "ffb: Could not register framebuffer.\n"); | 981 | printk(KERN_ERR "ffb: Could not register framebuffer.\n"); |
980 | fb_dealloc_cmap(&all->info.cmap); | 982 | fb_dealloc_cmap(&all->info.cmap); |
983 | of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); | ||
984 | of_iounmap(all->par.dac, sizeof(struct ffb_dac)); | ||
981 | kfree(all); | 985 | kfree(all); |
982 | return err; | 986 | return err; |
983 | } | 987 | } |