summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJerry Snitselaar2019-01-17 20:29:02 +0100
committerGreg Kroah-Hartman2019-03-13 22:02:27 +0100
commit697863bf7d724ad067988468b19f8b411993151b (patch)
tree750c1ffc0c72782ba09a2abb5ed8a31b20597bed /drivers/iommu
parentIB/{hfi1, qib}: Fix WC.byte_len calculation for UD_SEND_WITH_IMM (diff)
downloadkernel-qcow2-linux-697863bf7d724ad067988468b19f8b411993151b.tar.gz
kernel-qcow2-linux-697863bf7d724ad067988468b19f8b411993151b.tar.xz
kernel-qcow2-linux-697863bf7d724ad067988468b19f8b411993151b.zip
iommu/amd: Call free_iova_fast with pfn in map_sg
[ Upstream commit 51d8838d66d3249508940d8f59b07701f2129723 ] In the error path of map_sg, free_iova_fast is being called with address instead of the pfn. This results in a bad value getting into the rcache, and can result in hitting a BUG_ON when iova_magazine_free_pfns is called. Cc: Joerg Roedel <joro@8bytes.org> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com> Fixes: 80187fd39dcb ("iommu/amd: Optimize map_sg and unmap_sg") Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd_iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 34c9aa76a7bd..2a5c05ca7fca 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2561,7 +2561,7 @@ out_unmap:
}
out_free_iova:
- free_iova_fast(&dma_dom->iovad, address, npages);
+ free_iova_fast(&dma_dom->iovad, address >> PAGE_SHIFT, npages);
out_err:
return 0;