summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2007-03-09 10:41:04 +0100
committerAdrian Bunk <bunk@stusta.de>2007-03-09 10:41:04 +0100
commitec333318b748e4f4ac3679a197620503b6d19d20 (patch)
tree4dc983bf23645171c93af60e8c41dc459103fcd0
parent0096623513107562ede3254df8d50d86474e5a7a (diff)
downloadlwn-ec333318b748e4f4ac3679a197620503b6d19d20.tar.gz
lwn-ec333318b748e4f4ac3679a197620503b6d19d20.zip
SPARC64: Fix memory corruption in pci_4u_free_consistent()
The second argument to free_npages() was being incorrectly calculated, which would thus access far past the end of the arena->map[] bitmap. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Adrian Bunk <bunk@stusta.de>
-rw-r--r--arch/sparc64/kernel/pci_iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c
index f63f0653dd0e..df9a3648dbc9 100644
--- a/arch/sparc64/kernel/pci_iommu.c
+++ b/arch/sparc64/kernel/pci_iommu.c
@@ -282,7 +282,7 @@ void pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_
spin_lock_irqsave(&iommu->lock, flags);
- free_npages(iommu, dvma, npages);
+ free_npages(iommu, dvma - iommu->page_table_map_base, npages);
spin_unlock_irqrestore(&iommu->lock, flags);