Skip to content

Commit

Permalink
ACPI: fix single linked list manipulation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Len Brown committed Dec 20, 2006
1 parent 9185cfa commit f10bb25
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/acpi/pci_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f10bb25

Please sign in to comment.