summaryrefslogtreecommitdiff
path: root/drivers/video/savage
diff options
context:
space:
mode:
authorOlaf Hering <olh@suse.de>2005-09-09 13:04:55 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 13:58:01 -0700
commit6062bfa1644f401c08e78d5c8a161f7d11c5c830 (patch)
tree4b3a2af8cb84c5f568e9aec839f76955608774fe /drivers/video/savage
parent544393fe584d333480659a4bed30f5295355df11 (diff)
[PATCH] better error handing in savagefb_probe
err remains uninitialized of pci_request_regions fails. Found by Thorsten Kukuk, I added a few more checks. Signed-off-by: Olaf Hering <olh@suse.de> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/savage')
-rw-r--r--drivers/video/savage/savagefb_driver.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index abad90a3702c..86522888e0aa 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -1976,12 +1976,11 @@ static int __devinit savage_init_fb_info (struct fb_info *info,
info->pixmap.buf_align = 4;
info->pixmap.access_align = 32;
- fb_alloc_cmap (&info->cmap, NR_PALETTE, 0);
+ err = fb_alloc_cmap (&info->cmap, NR_PALETTE, 0);
+ if (!err)
info->flags |= FBINFO_HWACCEL_COPYAREA |
FBINFO_HWACCEL_FILLRECT |
FBINFO_HWACCEL_IMAGEBLIT;
-
- err = 0;
}
#endif
return err;
@@ -2009,14 +2008,14 @@ static int __devinit savagefb_probe (struct pci_dev* dev,
if (err)
goto failed_enable;
- if (pci_request_regions(dev, "savagefb")) {
+ if ((err = pci_request_regions(dev, "savagefb"))) {
printk(KERN_ERR "cannot request PCI regions\n");
goto failed_enable;
}
err = -ENOMEM;
- if (savage_init_fb_info(info, dev, id))
+ if ((err = savage_init_fb_info(info, dev, id)))
goto failed_init;
err = savage_map_mmio(info);
@@ -2024,6 +2023,7 @@ static int __devinit savagefb_probe (struct pci_dev* dev,
goto failed_mmio;
video_len = savage_init_hw(par);
+ /* FIXME: cant be negative */
if (video_len < 0) {
err = video_len;
goto failed_mmio;