Skip to content

Commit

Permalink
intel-iommu: Don't free too much in dma_pte_free_pagetable()
Browse files Browse the repository at this point in the history
The loop condition was wrong -- we should free a PMD only if its
_entire_ range is within the range we're intending to clear. The
early-termination condition was right, but not the loop.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 30, 2009
1 parent 1bf20f0 commit 3d7b0e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain,
if (tmp + level_size(level) - 1 > last_pfn)
return;

while (tmp <= last_pfn) {
while (tmp + level_size(level) - 1 <= last_pfn) {
pte = dma_pfn_level_pte(domain, tmp, level);
if (pte) {
free_pgtable_page(
Expand Down

0 comments on commit 3d7b0e4

Please sign in to comment.