aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorOlaf Hering <olh@suse.de>2005-09-09 16:04:55 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:58:01 -0400
commit6062bfa1644f401c08e78d5c8a161f7d11c5c830 (patch)
tree4b3a2af8cb84c5f568e9aec839f76955608774fe /drivers
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')
-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,
1976 info->pixmap.buf_align = 4; 1976 info->pixmap.buf_align = 4;
1977 info->pixmap.access_align = 32; 1977 info->pixmap.access_align = 32;
1978 1978
1979 fb_alloc_cmap (&info->cmap, NR_PALETTE, 0); 1979 err = fb_alloc_cmap (&info->cmap, NR_PALETTE, 0);
1980 if (!err)
1980 info->flags |= FBINFO_HWACCEL_COPYAREA | 1981 info->flags |= FBINFO_HWACCEL_COPYAREA |
1981 FBINFO_HWACCEL_FILLRECT | 1982 FBINFO_HWACCEL_FILLRECT |
1982 FBINFO_HWACCEL_IMAGEBLIT; 1983 FBINFO_HWACCEL_IMAGEBLIT;
1983
1984 err = 0;
1985 } 1984 }
1986#endif 1985#endif
1987 return err; 1986 return err;
@@ -2009,14 +2008,14 @@ static int __devinit savagefb_probe (struct pci_dev* dev,
2009 if (err) 2008 if (err)
2010 goto failed_enable; 2009 goto failed_enable;
2011 2010
2012 if (pci_request_regions(dev, "savagefb")) { 2011 if ((err = pci_request_regions(dev, "savagefb"))) {
2013 printk(KERN_ERR "cannot request PCI regions\n"); 2012 printk(KERN_ERR "cannot request PCI regions\n");
2014 goto failed_enable; 2013 goto failed_enable;
2015 } 2014 }
2016 2015
2017 err = -ENOMEM; 2016 err = -ENOMEM;
2018 2017
2019 if (savage_init_fb_info(info, dev, id)) 2018 if ((err = savage_init_fb_info(info, dev, id)))
2020 goto failed_init; 2019 goto failed_init;
2021 2020
2022 err = savage_map_mmio(info); 2021 err = savage_map_mmio(info);
@@ -2024,6 +2023,7 @@ static int __devinit savagefb_probe (struct pci_dev* dev,
2024 goto failed_mmio; 2023 goto failed_mmio;
2025 2024
2026 video_len = savage_init_hw(par); 2025 video_len = savage_init_hw(par);
2026 /* FIXME: cant be negative */
2027 if (video_len < 0) { 2027 if (video_len < 0) {
2028 err = video_len; 2028 err = video_len;
2029 goto failed_mmio; 2029 goto failed_mmio;