Skip to content

Commit

Permalink
sunxvr500: fix cmap memory leaks
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
Andres Salomon authored and Linus Torvalds committed Apr 1, 2009
1 parent ccb121e commit cc880a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/video/sunxvr500.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit cc880a7

Please sign in to comment.