Skip to contentSkip to conversation

sunxvr500: fix cmap memory leaks

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

lore
Share & tools
lore
#0 lore raw

PATCH 10/15 sunxvr500: fix cmap memory leaks

- fix cmap leak in removal path
- fix cmap leak when register_framebuffer fails

---
 drivers/video/sunxvr500.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/video/sunxvr500.c +5 -1
index c2ba51b..18b9507 100644
@@ -349,11 +349,14 @@ static int __devinit e3d_pci_register(struct pci_dev *pdev,
 	if (err < 0) {
 		printk(KERN_ERR "e3d: Could not register framebuffer %s\n",
 		       pci_name(pdev));
-		goto err_unmap_fb;
+		goto err_free_cmap;
 	}
 
 	return 0;
 
+err_free_cmap:
+	fb_dealloc_cmap(&info->cmap);
+
 err_unmap_fb:
 	iounmap(ep->fb_base);
 
@@ -389,6 +392,7 @@ static void __devexit e3d_pci_unregister(struct pci_dev *pdev)
 	pci_release_region(pdev, 0);
 	pci_release_region(pdev, 1);
 
+	fb_dealloc_cmap(&info->cmap);
         framebuffer_release(info);
 
 	pci_disable_device(pdev);
Signature · 9 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
#1 lore raw

From: Andres Salomon <[email protected]>
Date: Sat, 7 Feb 2009 12:15:40 -0500

[ Fixed typo in adaplas's email address ]

Quoted 4 lines

- fix cmap leak in removal path
- fix cmap leak when register_framebuffer fails

I assume the fbdev folks will pick this up or should I take it in my sparc tree?

Thanks.

#3 lore raw
In reply to Andrew Morton

From: Andrew Morton <[email protected]>
Date: Sun, 8 Feb 2009 17:50:24 -0800

Quoted 10 lines · On Sun, 08 Feb 2009 16:59:25 -0800 (PST) David Miller <[email protected]>…
Quoted 9 lines

From: Andres Salomon <[email protected]>
Date: Sat, 7 Feb 2009 12:15:40 -0500

[ Fixed typo in adaplas's email address ]

Quoted 3 lines

- fix cmap leak in removal path
- fix cmap leak when register_framebuffer fails

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I assume the fbdev folks will pick this up or should I take it in my sparc tree?

(fbdev folks == me) at present. I'll crunch on these 15 patches tomorrow. If you want to queue it in in a sparc tree so that it gets more-than-zero runtine testing then go for it.

Nah, you can take it, thanks Andrew :-)

#2 lore raw
In reply to David Miller
Quoted 5 lines · On Sun, 08 Feb 2009 16:59:25 -0800 (PST) David Miller <[email protected]>…

From: Andres Salomon <[email protected]>
Date: Sat, 7 Feb 2009 12:15:40 -0500

[ Fixed typo in adaplas's email address ]

Quoted 7 lines
Quoted 4 lines

- fix cmap leak in removal path
- fix cmap leak when register_framebuffer fails

I assume the fbdev folks will pick this up or should I take it in my sparc tree?

(fbdev folks == me) at present. I'll crunch on these 15 patches tomorrow. If you want to queue it in in a sparc tree so that it gets more-than-zero runtine testing then go for it.

------------------------------------------------------------------------------
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