intel-iommu: Don't keep freeing page zero 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/6a43e574c5af7d9bd084992b1c9c3cdbc3b6c0e9
Commit:     6a43e574c5af7d9bd084992b1c9c3cdbc3b6c0e9
Parent:     75e6bf9638992dfc0fec9c3ca10444c8e0d6a638
Author:     David Woodhouse <David.Woodhouse@intel.com>
AuthorDate: Thu Jul 2 12:02:34 2009 +0100
Committer:  David Woodhouse <David.Woodhouse@intel.com>
CommitDate: Thu Jul 2 12:02:38 2009 +0100

    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>
---
 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 dcf0295..5307542 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) &&
--
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 keep freeing page zero in dma_pte_free_pa..., Linux Kernel Mailing List..., (Fri Jul 3, 5:59 pm)