diff options
author | 2009-03-31 15:25:27 -0700 | |
---|---|---|
committer | 2009-04-01 08:59:31 -0700 | |
commit | cc880a715782fe31116284d90e0b5bfb1411535b (patch) | |
tree | be6e192a7fd89a4f5c028a35bfd972770552647d /drivers/video | |
parent | valkyriefb: check fb_alloc_cmap return value and handle failure properly (diff) | |
download | linux-cc880a715782fe31116284d90e0b5bfb1411535b.tar.gz linux-cc880a715782fe31116284d90e0b5bfb1411535b.tar.bz2 linux-cc880a715782fe31116284d90e0b5bfb1411535b.zip |
sunxvr500: fix cmap memory leaks
- fix cmap leak in removal path
- fix cmap leak when register_framebuffer fails
Signed-off-by: Andres Salomon <dilinger@debian.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/sunxvr500.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c index c2ba51b7ea18..18b950706cad 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); |