aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2014-03-28 07:28:40 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2014-03-28 07:28:40 -0400
commit63b4262478ee6384c7efb5279be54236e5d6361b (patch)
treeb76a1d8c045dd81b65d6b64463b9c4ecbbe42231 /drivers/iommu
parent11f1a7768cb9179b1f1ce6b8027df7531e0704e7 (diff)
iommu/vt-d: Only call dmar_acpi_dev_scope_init() if DRHD units present
As pointed out by Jörg and fixed in commit 11f1a7768 ("iommu/vt-d: Check for NULL pointer in dmar_acpi_dev_scope_init(), this code path can bizarrely get exercised even on AMD IOMMU systems with IRQ remapping enabled. In addition to the defensive check for NULL which Jörg added, let's also just avoid calling the function at all if there aren't an Intel IOMMU units in the system. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/dmar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index e531a2b07207..142650e82979 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -698,13 +698,13 @@ int __init dmar_dev_scope_init(void)
698 if (dmar_dev_scope_status != 1) 698 if (dmar_dev_scope_status != 1)
699 return dmar_dev_scope_status; 699 return dmar_dev_scope_status;
700 700
701 dmar_acpi_dev_scope_init();
702
703 if (list_empty(&dmar_drhd_units)) { 701 if (list_empty(&dmar_drhd_units)) {
704 dmar_dev_scope_status = -ENODEV; 702 dmar_dev_scope_status = -ENODEV;
705 } else { 703 } else {
706 dmar_dev_scope_status = 0; 704 dmar_dev_scope_status = 0;
707 705
706 dmar_acpi_dev_scope_init();
707
708 for_each_pci_dev(dev) { 708 for_each_pci_dev(dev) {
709 if (dev->is_virtfn) 709 if (dev->is_virtfn)
710 continue; 710 continue;