提交 8d4c767e 编写于 作者: A Amol Lad 提交者: Linus Torvalds

[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: NAmol Lad <amol@verismonetworks.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1b3349fa
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册