From: Suresh Siddha <suresh.b.siddha@intel.com>
To: mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, dwmw2@infradead.org,
Suresh Siddha <suresh.b.siddha@intel.com>,
Yinghai Lu <yhlu.kernel@gmail.com>
Subject: [patch 4/5] dmar: use list_for_each_entry_safe() in dmar_dev_scope_init()
Date: Wed, 03 Sep 2008 16:58:34 -0700 [thread overview]
Message-ID: <20080904000238.193359000@linux-os.sc.intel.com> (raw)
In-Reply-To: 20080904000237.746216000@linux-os.sc.intel.com
[-- Attachment #1: safe_traversal_in_dmar.patch --]
[-- Type: text/plain, Size: 1270 bytes --]
From: Suresh Siddha <suresh.b.siddha@intel.com>
Subject: dmar: use list_for_each_entry_safe() in dmar_dev_scope_init()
In dmar_dev_scope_init(), functions called under for_each_drhd_unit()/
for_each_rmrr_units() can delete the list entry under some error conditions.
So we should use list_for_each_entry_safe() for safe traversal.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Acked-by: Yinghai Lu <yhlu.kernel@gmail.com>
---
Index: tip/drivers/pci/dmar.c
===================================================================
--- tip.orig/drivers/pci/dmar.c 2008-09-03 14:43:02.000000000 -0700
+++ tip/drivers/pci/dmar.c 2008-09-03 14:50:15.000000000 -0700
@@ -397,10 +397,10 @@
int __init dmar_dev_scope_init(void)
{
- struct dmar_drhd_unit *drhd;
+ struct dmar_drhd_unit *drhd, *drhd_n;
int ret = -ENODEV;
- for_each_drhd_unit(drhd) {
+ list_for_each_entry_safe(drhd, drhd_n, &dmar_drhd_units, list) {
ret = dmar_parse_dev(drhd);
if (ret)
return ret;
@@ -408,8 +408,8 @@
#ifdef CONFIG_DMAR
{
- struct dmar_rmrr_unit *rmrr;
- for_each_rmrr_units(rmrr) {
+ struct dmar_rmrr_unit *rmrr, *rmrr_n;
+ list_for_each_entry_safe(rmrr, rmrr_n, &dmar_rmrr_units, list) {
ret = rmrr_parse_dev(rmrr);
if (ret)
return ret;
--
next prev parent reply other threads:[~2008-09-04 0:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-03 23:58 [patch 1/5] x2apic: fix reserved APIC register accesses in print_local_APIC() Suresh Siddha
2008-09-03 23:58 ` [patch 2/5] dmar: fix using early fixmap mapping for DMAR table parsing Suresh Siddha
2008-09-03 23:58 ` [patch 3/5] dmar: initialize the return value in dmar_parse_dev() Suresh Siddha
2008-09-03 23:58 ` Suresh Siddha [this message]
2008-09-03 23:58 ` [patch 5/5] dmar: fix dmar_parse_dev() devices_cnt error condition check Suresh Siddha
2008-09-04 11:06 ` [patch 1/5] x2apic: fix reserved APIC register accesses in print_local_APIC() Ingo Molnar
2008-09-04 17:51 ` Suresh Siddha
2008-09-05 8:10 ` Ingo Molnar
2008-09-05 9:18 ` Jesse Barnes
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=20080904000238.193359000@linux-os.sc.intel.com \
--to=suresh.b.siddha@intel.com \
--cc=dwmw2@infradead.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=yhlu.kernel@gmail.com \
/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