intel-iommu: Don't free too much in dma_pte_free_pagetable()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, July 3, 2009 - 5:59 pm

Gitweb:     http://git.kernel.org/linus/3d7b0e4154b4963d6bd39991ec8eaa09caeb3994
Commit:     3d7b0e4154b4963d6bd39991ec8eaa09caeb3994
Parent:     1bf20f0dc5629032ddd07617139d9fbca66c1642
Author:     David Woodhouse <David.Woodhouse@intel.com>
AuthorDate: Tue Jun 30 03:38:09 2009 +0100
Committer:  David Woodhouse <David.Woodhouse@intel.com>
CommitDate: Tue Jun 30 03:57:38 2009 +0100

    intel-iommu: Don't free too much in dma_pte_free_pagetable()
    
    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>
---
 drivers/pci/intel-iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 40ce5a0..35bdd2a 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -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(
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
intel-iommu: Don't free too much in dma_pte_free_pagetable(), Linux Kernel Mailing List..., (Fri Jul 3, 5:59 pm)