Commit 327fc875 authored by Andres Salomon's avatar Andres Salomon Committed by Linus Torvalds

tgafb: fix cmap memory leak

Fix cmap leak when register_framebuffer fails.
Signed-off-by: default avatarAndres Salomon <dilinger@debian.org>
Acked-by: default avatarKrzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cc880a71
...@@ -1663,7 +1663,7 @@ tgafb_register(struct device *dev) ...@@ -1663,7 +1663,7 @@ tgafb_register(struct device *dev)
if (register_framebuffer(info) < 0) { if (register_framebuffer(info) < 0) {
printk(KERN_ERR "tgafb: Could not register framebuffer\n"); printk(KERN_ERR "tgafb: Could not register framebuffer\n");
ret = -EINVAL; ret = -EINVAL;
goto err1; goto err2;
} }
if (tga_bus_pci) { if (tga_bus_pci) {
...@@ -1682,6 +1682,8 @@ tgafb_register(struct device *dev) ...@@ -1682,6 +1682,8 @@ tgafb_register(struct device *dev)
return 0; return 0;
err2:
fb_dealloc_cmap(&info->cmap);
err1: err1:
if (mem_base) if (mem_base)
iounmap(mem_base); iounmap(mem_base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment