From: Andres Salomon Date: Tue, 31 Mar 2009 22:25:28 +0000 (-0700) Subject: tgafb: fix cmap memory leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=327fc8752a3c08fc7dc7d382883e65aad2f03bde;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git tgafb: fix cmap memory leak Fix cmap leak when register_framebuffer fails. Signed-off-by: Andres Salomon Acked-by: Krzysztof Helt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c index 680642c089c..a86046ff60a 100644 --- a/drivers/video/tgafb.c +++ b/drivers/video/tgafb.c @@ -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) { @@ -1682,6 +1682,8 @@ tgafb_register(struct device *dev) return 0; + err2: + fb_dealloc_cmap(&info->cmap); err1: if (mem_base) iounmap(mem_base);