mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-27 04:54:41 +08:00
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>
This commit is contained in:
parent
9185cfa925
commit
f10bb2544b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user