]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
SPARC64: Fix memory corruption in pci_4u_free_consistent()
authorDavid S. Miller <davem@davemloft.net>
Fri, 9 Mar 2007 09:41:04 +0000 (10:41 +0100)
committerAdrian Bunk <bunk@stusta.de>
Fri, 9 Mar 2007 09:41:04 +0000 (10:41 +0100)
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>
arch/sparc64/kernel/pci_iommu.c

index f63f0653dd0e84b8be2dec9d7f31205d74c9a9e9..df9a3648dbc98e6fa4ec043d8b0da053c2180f60 100644 (file)
@@ -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);