diff options
author | Andres Salomon <dilinger@queued.net> | 2009-03-31 18:25:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-01 11:59:31 -0400 |
commit | cc880a715782fe31116284d90e0b5bfb1411535b (patch) | |
tree | be6e192a7fd89a4f5c028a35bfd972770552647d /drivers/video/sunxvr500.c | |
parent | ccb121e6958eca5f58938e56523fc589fed36fa8 (diff) |
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/sunxvr500.c')
-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, | |||
349 | if (err < 0) { | 349 | if (err < 0) { |
350 | printk(KERN_ERR "e3d: Could not register framebuffer %s\n", | 350 | printk(KERN_ERR "e3d: Could not register framebuffer %s\n", |
351 | pci_name(pdev)); | 351 | pci_name(pdev)); |
352 | goto err_unmap_fb; | 352 | goto err_free_cmap; |
353 | } | 353 | } |
354 | 354 | ||
355 | return 0; | 355 | return 0; |
356 | 356 | ||
357 | err_free_cmap: | ||
358 | fb_dealloc_cmap(&info->cmap); | ||
359 | |||
357 | err_unmap_fb: | 360 | err_unmap_fb: |
358 | iounmap(ep->fb_base); | 361 | iounmap(ep->fb_base); |
359 | 362 | ||
@@ -389,6 +392,7 @@ static void __devexit e3d_pci_unregister(struct pci_dev *pdev) | |||
389 | pci_release_region(pdev, 0); | 392 | pci_release_region(pdev, 0); |
390 | pci_release_region(pdev, 1); | 393 | pci_release_region(pdev, 1); |
391 | 394 | ||
395 | fb_dealloc_cmap(&info->cmap); | ||
392 | framebuffer_release(info); | 396 | framebuffer_release(info); |
393 | 397 | ||
394 | pci_disable_device(pdev); | 398 | pci_disable_device(pdev); |