[AMD76X]
From: Herbert Xu
Date: Sat Aug 23 2003 - 18:52:35 EST
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,
--
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
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;
}