Skip to content

Commit

Permalink
[SPARC64]: Fix memory corruption in pci_4u_free_consistent().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Oct 26, 2006
1 parent 4130a4b commit 012d64f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sparc64/kernel/pci_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ static void pci_4u_free_consistent(struct pci_dev *pdev, size_t size, void *cpu,

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);

Expand Down

0 comments on commit 012d64f

Please sign in to comment.