[AMD76X]
diff mbox series

Message ID 20030823233323.GA7989@gondor.apana.org.au
State New, archived
Headers show
Series
  • [AMD76X]
Related show

Commit Message

Herbert Xu Aug. 23, 2003, 11:33 p.m. UTC
Hi:

amd76x_pm.c will crash if no chipsets are found and CONFIG_HOTPLUG is
turned on.  This patch makes it return with a failure instead.

Cheers,

Comments

Willy TARREAU Aug. 24, 2003, 5:53 p.m. UTC | #1
On Sun, Aug 24, 2003 at 09:33:23AM +1000, Herbert Xu wrote:
> Hi:
> 
> amd76x_pm.c will crash if no chipsets are found and CONFIG_HOTPLUG is
> turned on.  This patch makes it return with a failure instead.

Hi !

I'm wondering whether this patch should be needed too.

Cheers,
Willy

--- linux-2.4.22-rc3/drivers/char/amd76x_pm.c.orig	Sun Aug 24 19:52:42 2003
+++ linux-2.4.22-rc3/drivers/char/amd76x_pm.c	Sun Aug 24 19:53:49 2003
@@ -620,6 +620,8 @@
 #ifndef AMD76X_NTH
 	if (!amd76x_pm_cfg.curr_idle) {
 		printk(KERN_ERR "amd76x_pm: Idle function not changed\n");
+		pci_unregister_driver(&amd_nb_driver);
+		pci_unregister_driver(&amd_sb_driver);
 		return 1;
 	}
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Herbert Xu Aug. 25, 2003, 8:12 a.m. UTC | #2
On Sun, Aug 24, 2003 at 07:53:21PM +0200, Willy Tarreau wrote:
> 
> I'm wondering whether this patch should be needed too.
> 
> --- linux-2.4.22-rc3/drivers/char/amd76x_pm.c.orig	Sun Aug 24 19:52:42 2003
> +++ linux-2.4.22-rc3/drivers/char/amd76x_pm.c	Sun Aug 24 19:53:49 2003
> @@ -620,6 +620,8 @@
>  #ifndef AMD76X_NTH
>  	if (!amd76x_pm_cfg.curr_idle) {
>  		printk(KERN_ERR "amd76x_pm: Idle function not changed\n");
> +		pci_unregister_driver(&amd_nb_driver);
> +		pci_unregister_driver(&amd_sb_driver);
>  		return 1;
>  	}

Although this error is currently not possible, we should include
your fixup anyway.

Thanks,

Patch
diff mbox series

Index: kernel-source-2.4/drivers/char/amd76x_pm.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/drivers/char/amd76x_pm.c,v
retrieving revision 1.2
diff -u -r1.2 amd76x_pm.c
--- kernel-source-2.4/drivers/char/amd76x_pm.c	1 Dec 2002 05:52:05 -0000	1.2
+++ kernel-source-2.4/drivers/char/amd76x_pm.c	23 Aug 2003 23:30:11 -0000
@@ -577,16 +577,18 @@ 
 	int found;
 
 	/* Find northbridge */
-	found = pci_module_init(&amd_nb_driver);
-	if (found < 0) {
+	found = pci_register_driver(&amd_nb_driver);
+	if (found <= 0) {
 		printk(KERN_ERR "amd76x_pm: Could not find northbridge\n");
+		pci_unregister_driver(&amd_nb_driver);
 		return 1;
 	}
 
 	/* Find southbridge */
-	found = pci_module_init(&amd_sb_driver);
-	if (found < 0) {
+	found = pci_register_driver(&amd_sb_driver);
+	if (found <= 0) {
 		printk(KERN_ERR "amd76x_pm: Could not find southbridge\n");
+		pci_unregister_driver(&amd_sb_driver);
 		pci_unregister_driver(&amd_nb_driver);
 		return 1;
 	}