diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-07-02 15:02:34 +0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-07-02 15:02:38 +0400 |
commit | 6a43e574c5af7d9bd084992b1c9c3cdbc3b6c0e9 (patch) | |
tree | 64f32c60749008747d201b7168b33e1181682bf2 /drivers/pci/intel-iommu.c | |
parent | 75e6bf9638992dfc0fec9c3ca10444c8e0d6a638 (diff) | |
download | linux-6a43e574c5af7d9bd084992b1c9c3cdbc3b6c0e9.tar.xz |
intel-iommu: Don't keep freeing page zero in dma_pte_free_pagetable()
Check dma_pte_present() and only free the page if there _is_ one.
Kind of surprising that there was no warning about this.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/intel-iommu.c')
-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, continue; } do { - free_pgtable_page(phys_to_virt(dma_pte_addr(pte))); - dma_clear_pte(pte); + if (dma_pte_present(pte)) { + free_pgtable_page(phys_to_virt(dma_pte_addr(pte))); + dma_clear_pte(pte); + } pte++; tmp += level_size(level); } while (!first_pte_in_page(pte) && |