aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-12-19 15:56:09 -0500
committerLen Brown <len.brown@intel.com>2006-12-20 00:30:48 -0500
commitf10bb2544bab75b3e8df15a7b51a833c78cbd77f (patch)
tree6d099f8c14ccdaca92b2100b8548afe536e56a14 /drivers
parent9185cfa92507d07ac787bc73d06c42222eec7239 (diff)
ACPI: fix single linked list manipulation
Fix single linked list manipulation for sub_driver. If the remving entry is not on the head of the sub_driver list, it goes into infinate loop. Though that infinite loop doesn't happen. Because the only user of acpi_pci_register_dirver() is acpiphp. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/pci_root.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 0984a1ee24ed..c92c144d6c58 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -98,11 +98,12 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
98 98
99 struct acpi_pci_driver **pptr = &sub_driver; 99 struct acpi_pci_driver **pptr = &sub_driver;
100 while (*pptr) { 100 while (*pptr) {
101 if (*pptr != driver) 101 if (*pptr == driver)
102 continue; 102 break;
103 *pptr = (*pptr)->next; 103 pptr = &(*pptr)->next;
104 break;
105 } 104 }
105 BUG_ON(!*pptr);
106 *pptr = (*pptr)->next;
106 107
107 if (!driver->remove) 108 if (!driver->remove)
108 return; 109 return;