All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 02/19] acpi: fix single linked list manipulation
@ 2006-12-19 20:56 akpm
  2006-12-20  5:43 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2006-12-19 20:56 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, akpm, akinobu.mita, len.brown

From: Akinobu Mita <akinobu.mita@gmail.com>

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.

Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/acpi/pci_root.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff -puN drivers/acpi/pci_root.c~acpi-fix-single-linked-list-manipulation drivers/acpi/pci_root.c
--- a/drivers/acpi/pci_root.c~acpi-fix-single-linked-list-manipulation
+++ a/drivers/acpi/pci_root.c
@@ -98,11 +98,12 @@ void acpi_pci_unregister_driver(struct a
 
 	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;
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-20  5:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-19 20:56 [patch 02/19] acpi: fix single linked list manipulation akpm
2006-12-20  5:43 ` Len Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.