From: Andres Salomon Date: Tue, 31 Mar 2009 22:25:27 +0000 (-0700) Subject: sunxvr500: fix cmap memory leaks X-Git-Tag: v2.6.30-rc1~444 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc880a715782fe31116284d90e0b5bfb1411535b;p=platform%2Fkernel%2Flinux-stable.git sunxvr500: fix cmap memory leaks - fix cmap leak in removal path - fix cmap leak when register_framebuffer fails Signed-off-by: Andres Salomon Cc: "David S. Miller" Cc: Krzysztof Helt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c index c2ba51b..18b9507 100644 --- a/drivers/video/sunxvr500.c +++ b/drivers/video/sunxvr500.c @@ -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);