aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2009-03-31 18:25:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 11:59:30 -0400
commitc23124277e58998703278c26c53b159cea0f9643 (patch)
tree87a24c0697640cfbd0f1e3211d22d426d26706fb /drivers/video
parent0a5d924e5954e81a905907512f8c7a1cbf81d700 (diff)
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/video')
-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 5b11a00f49bc..609d0a521ca2 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -1421,13 +1421,16 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
1421 goto fail; 1421 goto fail;
1422 } 1422 }
1423 1423
1424 fb_alloc_cmap(&info->cmap, 256, 0); 1424 if (fb_alloc_cmap(&info->cmap, 256, 0)) {
1425 printk(KERN_ERR "sstfb: can't alloc cmap memory.\n");
1426 goto fail;
1427 }
1425 1428
1426 /* register fb */ 1429 /* register fb */
1427 info->device = &pdev->dev; 1430 info->device = &pdev->dev;
1428 if (register_framebuffer(info) < 0) { 1431 if (register_framebuffer(info) < 0) {
1429 printk(KERN_ERR "sstfb: can't register framebuffer.\n"); 1432 printk(KERN_ERR "sstfb: can't register framebuffer.\n");
1430 goto fail; 1433 goto fail_register;
1431 } 1434 }
1432 1435
1433 sstfb_clear_screen(info); 1436 sstfb_clear_screen(info);
@@ -1441,8 +1444,9 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
1441 1444
1442 return 0; 1445 return 0;
1443 1446
1444fail: 1447fail_register:
1445 fb_dealloc_cmap(&info->cmap); 1448 fb_dealloc_cmap(&info->cmap);
1449fail:
1446 iounmap(info->screen_base); 1450 iounmap(info->screen_base);
1447fail_fb_remap: 1451fail_fb_remap:
1448 iounmap(par->mmio_vbase); 1452 iounmap(par->mmio_vbase);