Commit 8519dc44 authored by Mike Habeck's avatar Mike Habeck Committed by David Woodhouse

intel-iommu: Add domain check in domain_remove_one_dev_info

The comment in domain_remove_one_dev_info() states "No need to compare
PCI domain; it has to be the same". But for the si_domain that isn't
going to be true, as it consists of all the PCI devices that are
identity mapped thus multiple PCI domains can be in si_domain.  The
code needs to validate the PCI domain too.
Signed-off-by: default avatarMike Habeck <habeck@sgi.com>
Signed-off-by: default avatarMike Travis <travis@sgi.com>
Cc: stable@kernel.org
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 825507d6
...@@ -3537,8 +3537,8 @@ static void domain_remove_one_dev_info(struct dmar_domain *domain, ...@@ -3537,8 +3537,8 @@ static void domain_remove_one_dev_info(struct dmar_domain *domain,
spin_lock_irqsave(&device_domain_lock, flags); spin_lock_irqsave(&device_domain_lock, flags);
list_for_each_safe(entry, tmp, &domain->devices) { list_for_each_safe(entry, tmp, &domain->devices) {
info = list_entry(entry, struct device_domain_info, link); info = list_entry(entry, struct device_domain_info, link);
/* No need to compare PCI domain; it has to be the same */ if (info->segment == pci_domain_nr(pdev->bus) &&
if (info->bus == pdev->bus->number && info->bus == pdev->bus->number &&
info->devfn == pdev->devfn) { info->devfn == pdev->devfn) {
list_del(&info->link); list_del(&info->link);
list_del(&info->global); list_del(&info->global);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment