From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Cc: Len Brown <len.brown@intel.com>
Subject: [PATCH] acpi: fix single linked list manipulation
Date: Sun, 29 Oct 2006 03:53:13 +0900 [thread overview]
Message-ID: <20061028185313.GK9973@localhost> (raw)
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;
next reply other threads:[~2006-10-28 18:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-28 18:53 Akinobu Mita [this message]
2006-10-28 19:02 ` [PATCH] acpi: fix single linked list manipulation 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061028185313.GK9973@localhost \
--to=akinobu.mita@gmail.com \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox