aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 15e9b57e9cf0..43b9bfea48fa 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -782,7 +782,11 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
782 int offset; 782 int offset;
783 783
784 BUG_ON(!domain->pgd); 784 BUG_ON(!domain->pgd);
785 BUG_ON(addr_width < BITS_PER_LONG && pfn >> addr_width); 785
786 if (addr_width < BITS_PER_LONG && pfn >> addr_width)
787 /* Address beyond IOMMU's addressing capabilities. */
788 return NULL;
789
786 parent = domain->pgd; 790 parent = domain->pgd;
787 791
788 while (level > 0) { 792 while (level > 0) {
@@ -3777,11 +3781,10 @@ static void iommu_detach_dependent_devices(struct intel_iommu *iommu,
3777static void domain_remove_one_dev_info(struct dmar_domain *domain, 3781static void domain_remove_one_dev_info(struct dmar_domain *domain,
3778 struct pci_dev *pdev) 3782 struct pci_dev *pdev)
3779{ 3783{
3780 struct device_domain_info *info; 3784 struct device_domain_info *info, *tmp;
3781 struct intel_iommu *iommu; 3785 struct intel_iommu *iommu;
3782 unsigned long flags; 3786 unsigned long flags;
3783 int found = 0; 3787 int found = 0;
3784 struct list_head *entry, *tmp;
3785 3788
3786 iommu = device_to_iommu(pci_domain_nr(pdev->bus), pdev->bus->number, 3789 iommu = device_to_iommu(pci_domain_nr(pdev->bus), pdev->bus->number,
3787 pdev->devfn); 3790 pdev->devfn);
@@ -3789,8 +3792,7 @@ static void domain_remove_one_dev_info(struct dmar_domain *domain,
3789 return; 3792 return;
3790 3793
3791 spin_lock_irqsave(&device_domain_lock, flags); 3794 spin_lock_irqsave(&device_domain_lock, flags);
3792 list_for_each_safe(entry, tmp, &domain->devices) { 3795 list_for_each_entry_safe(info, tmp, &domain->devices, link) {
3793 info = list_entry(entry, struct device_domain_info, link);
3794 if (info->segment == pci_domain_nr(pdev->bus) && 3796 if (info->segment == pci_domain_nr(pdev->bus) &&
3795 info->bus == pdev->bus->number && 3797 info->bus == pdev->bus->number &&
3796 info->devfn == pdev->devfn) { 3798 info->devfn == pdev->devfn) {