From: Akinobu Mita Date: Tue, 19 Dec 2006 20:56:09 +0000 (-0800) Subject: ACPI: fix single linked list manipulation X-Git-Tag: v2.6.20-rc2~6^2~3^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f10bb2544bab75b3e8df15a7b51a833c78cbd77f;p=linux-2.6 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 Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 0984a1ee24..c92c144d6c 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) struct acpi_pci_driver **pptr = &sub_driver; while (*pptr) { - if (*pptr != driver) - continue; - *pptr = (*pptr)->next; - break; + if (*pptr == driver) + break; + pptr = &(*pptr)->next; } + BUG_ON(!*pptr); + *pptr = (*pptr)->next; if (!driver->remove) return;