Skip to content

Commit

Permalink
iommu/vt-d: Only call dmar_acpi_dev_scope_init() if DRHD units present
Browse files Browse the repository at this point in the history
As pointed out by Jörg and fixed in commit 11f1a77 ("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>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Mar 28, 2014
1 parent 11f1a77 commit 63b4262
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iommu/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,13 @@ int __init dmar_dev_scope_init(void)
if (dmar_dev_scope_status != 1)
return dmar_dev_scope_status;

dmar_acpi_dev_scope_init();

if (list_empty(&dmar_drhd_units)) {
dmar_dev_scope_status = -ENODEV;
} else {
dmar_dev_scope_status = 0;

dmar_acpi_dev_scope_init();

for_each_pci_dev(dev) {
if (dev->is_virtfn)
continue;
Expand Down

0 comments on commit 63b4262

Please sign in to comment.