Pull bugfix into test branch
[powerpc.git] / drivers / acpi / pci_root.c
index 03e0374..b9c52cd 100644 (file)
@@ -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;