提交 6a43e574 编写于 作者: D David Woodhouse

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: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 75e6bf96
...@@ -826,8 +826,10 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain, ...@@ -826,8 +826,10 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain,
continue; continue;
} }
do { do {
free_pgtable_page(phys_to_virt(dma_pte_addr(pte))); if (dma_pte_present(pte)) {
dma_clear_pte(pte); free_pgtable_page(phys_to_virt(dma_pte_addr(pte)));
dma_clear_pte(pte);
}
pte++; pte++;
tmp += level_size(level); tmp += level_size(level);
} while (!first_pte_in_page(pte) && } while (!first_pte_in_page(pte) &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册