From: Mike Habeck Date: Sat, 28 May 2011 18:15:07 +0000 (-0500) Subject: intel-iommu: Add domain check in domain_remove_one_dev_info X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8519dc4401ddf8a5399f979870bbeeadbc111186;p=mv-sheeva.git 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: Mike Habeck Signed-off-by: Mike Travis Cc: stable@kernel.org Signed-off-by: David Woodhouse --- diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 7f757ce60c5..b0c96d39080 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c @@ -3537,8 +3537,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);