Skip to content

Commit

Permalink
intel-iommu: Don't keep freeing page zero in dma_pte_free_pagetable()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jul 2, 2009
1 parent 75e6bf9 commit 6a43e57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down

0 comments on commit 6a43e57

Please sign in to comment.