Skip to contentSkip to conversation

tgafb: fix cmap memory leak

PATCH In review Andres Salomon 2 participants 2 messages Feb 7, 2009 – Feb 9, 2009 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 11/15 tgafb: fix cmap memory leak

- fix cmap leak when register_framebuffer fails

---
 drivers/video/tgafb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/video/tgafb.c +3 -1
index 680642c..a86046f 100644
@@ -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);
Signature · 1 line
1.5.6.5
Acked-by on v1 11/15
#1 lore raw
Quoted 5 lines · On Sat, 7 Feb 2009 12:18:31 -0500 Andres Salomon <[email protected]> wrote:

- fix cmap leak when register_framebuffer fails

---

Quoted 40 lines
 drivers/video/tgafb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/video/tgafb.c +3 -1
index 680642c..a86046f 100644
@@ -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);
Signature · 13 lines
1.5.6.5


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Linux-fbdev-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel