public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpi: fix single linked list manipulation
@ 2006-10-28 18:53 Akinobu Mita
  2006-10-28 19:02 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Akinobu Mita @ 2006-10-28 18:53 UTC (permalink / raw)
  To: linux-kernel, linux-acpi; +Cc: Len Brown

This patch fixes 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 infinate 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>

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

Index: work-fault-inject/drivers/acpi/pci_root.c
===================================================================
--- work-fault-inject.orig/drivers/acpi/pci_root.c
+++ work-fault-inject/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] 4+ messages in thread

end of thread, other threads:[~2006-10-29 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-28 18:53 [PATCH] acpi: fix single linked list manipulation Akinobu Mita
2006-10-28 19:02 ` Christoph Hellwig
2006-10-29 13:40   ` [PATCH -mm] acpi: use list.h API for sub_driver list Akinobu Mita
2006-10-29 13:42     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox