Skip to content

Commit

Permalink
tgafb: fix cmap memory leak
Browse files Browse the repository at this point in the history
Fix cmap leak when register_framebuffer fails.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Acked-by: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andres Salomon authored and Linus Torvalds committed Apr 1, 2009
1 parent cc880a7 commit 327fc87
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/video/tgafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,7 @@ tgafb_register(struct device *dev)
if (register_framebuffer(info) < 0) {
printk(KERN_ERR "tgafb: Could not register framebuffer\n");
ret = -EINVAL;
goto err1;
goto err2;
}

if (tga_bus_pci) {
Expand All @@ -1682,6 +1682,8 @@ tgafb_register(struct device *dev)

return 0;

err2:
fb_dealloc_cmap(&info->cmap);
err1:
if (mem_base)
iounmap(mem_base);
Expand Down

0 comments on commit 327fc87

Please sign in to comment.