diff options
-rw-r--r-- | drivers/pci/intel-iommu.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index dcf0295a9b60..53075424a434 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -826,8 +826,10 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain, | |||
826 | continue; | 826 | continue; |
827 | } | 827 | } |
828 | do { | 828 | do { |
829 | free_pgtable_page(phys_to_virt(dma_pte_addr(pte))); | 829 | if (dma_pte_present(pte)) { |
830 | dma_clear_pte(pte); | 830 | free_pgtable_page(phys_to_virt(dma_pte_addr(pte))); |
831 | dma_clear_pte(pte); | ||
832 | } | ||
831 | pte++; | 833 | pte++; |
832 | tmp += level_size(level); | 834 | tmp += level_size(level); |
833 | } while (!first_pte_in_page(pte) && | 835 | } while (!first_pte_in_page(pte) && |