All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] better error handing in savagefb_probe
@ 2005-08-29 19:42 Olaf Hering
  2005-08-30  1:09 ` Antonino A. Daplas
  0 siblings, 1 reply; 2+ messages in thread
From: Olaf Hering @ 2005-08-29 19:42 UTC (permalink / raw)
  To: Andrew Morton, Antonino A. Daplas, linux-fbdev-devel


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>

 drivers/video/savage/savagefb_driver.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

Index: linux-2.6.13-savage/drivers/video/savage/savagefb_driver.c
===================================================================
--- linux-2.6.13-savage.orig/drivers/video/savage/savagefb_driver.c
+++ linux-2.6.13-savage/drivers/video/savage/savagefb_driver.c
@@ -1899,12 +1899,11 @@ static int __devinit savage_init_fb_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;
@@ -1932,14 +1931,14 @@ static int __devinit savagefb_probe (str
 	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);
@@ -1947,6 +1946,7 @@ static int __devinit savagefb_probe (str
 		goto failed_mmio;
 
 	video_len = savage_init_hw(par);
+	/* FIXME: cant be negative */
 	if (video_len < 0) {
 		err = video_len;
 		goto failed_mmio;


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] better error handing in savagefb_probe
  2005-08-29 19:42 [PATCH] better error handing in savagefb_probe Olaf Hering
@ 2005-08-30  1:09 ` Antonino A. Daplas
  0 siblings, 0 replies; 2+ messages in thread
From: Antonino A. Daplas @ 2005-08-30  1:09 UTC (permalink / raw)
  Cc: Andrew Morton, linux-fbdev-devel, Olaf Hering

Olaf Hering wrote:
> 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>

Thanks, I've added this to my tree. I'll push this to Andrew
on my next patch drop.

Tony


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-30  1:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-29 19:42 [PATCH] better error handing in savagefb_probe Olaf Hering
2005-08-30  1:09 ` Antonino A. Daplas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.