From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI fixes for 2.6.9
Date: Tue, 19 Oct 2004 15:42:11 -0700 [thread overview]
Message-ID: <10982257312950@kroah.com> (raw)
In-Reply-To: <10982257313321@kroah.com>
ChangeSet 1.1997.2.122, 2004/10/15 12:00:07-07:00, johnrose@austin.ibm.com
[PATCH] PCI Hotplug: rpaphp safe list traversal
Hoping you will accept this fix. The bug can cause a crash upon hotplug
remove. The bug involves unsafe traversal of a list while deleting list
members. The fix uses list_for_each_safe() rather than
list_for_each(). Also threw in an initialization to get rid of a
compiler warning.
Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/pci/hotplug/rpaphp_pci.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff -Nru a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
--- a/drivers/pci/hotplug/rpaphp_pci.c 2004-10-19 15:21:10 -07:00
+++ b/drivers/pci/hotplug/rpaphp_pci.c 2004-10-19 15:21:10 -07:00
@@ -118,7 +118,7 @@
{
int state, rc;
struct device_node *child_dn;
- struct pci_dev *child_dev;
+ struct pci_dev *child_dev = NULL;
*value = NOT_VALID;
rc = rpaphp_get_sensor_state(slot, &state);
@@ -369,7 +369,7 @@
int rpaphp_unconfig_pci_adapter(struct slot *slot)
{
int retval = 0;
- struct list_head *ln;
+ struct list_head *ln, *tmp;
dbg("Entry %s: slot[%s]\n", __FUNCTION__, slot->name);
if (list_empty(&slot->dev.pci_funcs)) {
@@ -380,7 +380,7 @@
goto exit;
}
/* remove the devices from the pci core */
- list_for_each (ln, &slot->dev.pci_funcs) {
+ list_for_each_safe (ln, tmp, &slot->dev.pci_funcs) {
struct rpaphp_pci_func *func;
func = list_entry(ln, struct rpaphp_pci_func, sibling);
next prev parent reply other threads:[~2004-10-19 23:42 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-19 22:37 [BK PATCH] PCI fixes for 2.6.9 Greg KH
2004-10-19 22:42 ` [PATCH] " Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH [this message]
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-19 22:42 ` Greg KH
2004-10-20 8:10 ` Russell King
2004-10-22 23:45 ` Greg KH
2004-10-24 16:47 ` Alan Cox
2004-11-20 18:45 ` Russell King
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=10982257312950@kroah.com \
--to=greg@kroah.com \
--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;
as well as URLs for NNTP newsgroup(s).