summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2009-03-31 15:25:25 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 08:59:30 -0700
commitc23124277e58998703278c26c53b159cea0f9643 (patch)
tree87a24c0697640cfbd0f1e3211d22d426d26706fb /drivers
parent0a5d924e5954e81a905907512f8c7a1cbf81d700 (diff)
downloadlinux-3.10-c23124277e58998703278c26c53b159cea0f9643.tar.gz
linux-3.10-c23124277e58998703278c26c53b159cea0f9643.tar.bz2
linux-3.10-c23124277e58998703278c26c53b159cea0f9643.zip
sstfb: check fb_alloc_cmap return value and handle failure properly
Signed-off-by: Andres Salomon <dilinger@debian.org> Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/sstfb.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index 5b11a00f49b..609d0a521ca 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -1421,13 +1421,16 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
goto fail;
}
- fb_alloc_cmap(&info->cmap, 256, 0);
+ if (fb_alloc_cmap(&info->cmap, 256, 0)) {
+ printk(KERN_ERR "sstfb: can't alloc cmap memory.\n");
+ goto fail;
+ }
/* register fb */
info->device = &pdev->dev;
if (register_framebuffer(info) < 0) {
printk(KERN_ERR "sstfb: can't register framebuffer.\n");
- goto fail;
+ goto fail_register;
}
sstfb_clear_screen(info);
@@ -1441,8 +1444,9 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
return 0;
-fail:
+fail_register:
fb_dealloc_cmap(&info->cmap);
+fail:
iounmap(info->screen_base);
fail_fb_remap:
iounmap(par->mmio_vbase);