summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMike Habeck <habeck@sgi.com>2011-05-28 13:15:07 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-23 15:05:31 -0700
commitf4f6cfc11c3481c36cc3c8cff15dd756ddf1748e (patch)
tree100f70e944ff7ff3debe605b49c2100e35affac9 /drivers
parentb8f794de1463ab32ed90c97ad6edbcecd931abed (diff)
intel-iommu: Add domain check in domain_remove_one_dev_info
commit 8519dc4401ddf8a5399f979870bbeeadbc111186 upstream. 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: Mike Habeck <habeck@sgi.com> Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/intel-iommu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 9593496fe4c4..5db70c73c30e 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -3398,8 +3398,8 @@ static void domain_remove_one_dev_info(struct dmar_domain *domain,
spin_lock_irqsave(&device_domain_lock, flags);
list_for_each_safe(entry, tmp, &domain->devices) {
info = list_entry(entry, struct device_domain_info, link);
- /* No need to compare PCI domain; it has to be the same */
- if (info->bus == pdev->bus->number &&
+ if (info->segment == pci_domain_nr(pdev->bus) &&
+ info->bus == pdev->bus->number &&
info->devfn == pdev->devfn) {
list_del(&info->link);
list_del(&info->global);