Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54ea4d34 authored by Isaac J. Manjarres's avatar Isaac J. Manjarres
Browse files

iommu: iommu-debug: Fix input IOVA usage in atos_write()



atos_write() uses the IOVA stored in the debug device structure
for translating the input IOVA to a physical address, which is
not correct, given that the debug device structure's IOVA field
has not been initialized yet. Use the IOVA given as an input
for translating the IOVA to a physical address.

Change-Id: I7a8f241abc573fcf877147ca4d808c025cbb45f9
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent 1264c046
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1521,7 +1521,7 @@ static ssize_t iommu_debug_atos_write(struct file *file,
		return -EINVAL;
	}

	phys = iommu_iova_to_phys(ddev->domain, ddev->iova);
	phys = iommu_iova_to_phys(ddev->domain, iova);
	pfn = __phys_to_pfn(phys);
	if (!pfn_valid(pfn)) {
		dev_err(ddev->dev, "Invalid ATOS operation page %pa\n", &phys);