summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchel Humpherys <mitchelh@codeaurora.org>2015-10-22 13:48:29 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:14:28 -0700
commitb47628bf9f6edd902e06be4ad669795f350dfe46 (patch)
treec910137b6048ae5477d85675a0833cb0406bf984
parentb6d3fe22042b31a35d6830eeebaf5ca9ff4a1da6 (diff)
iommu: io-pgtable-arm: Correctly update *size in map_sg
Currently, in the arm_lpae_map_sg early return path (when neither READ nor WRITE permissions were specified), we don't store the "partially mapped" size in the size output parameter, as is expected. This could result in someone up the stack using an uninitialized variable. Fix this by storing 0 in *size when there's nothing to do. Change-Id: I3b0952aa5bcc2810843b7c513c32c3d665169e40 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
-rw-r--r--drivers/iommu/io-pgtable-arm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 90d0438a47ed..5fcb56371847 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -479,7 +479,7 @@ static int arm_lpae_map_sg(struct io_pgtable_ops *ops, unsigned long iova,
/* If no access, then nothing to do */
if (!(iommu_prot & (IOMMU_READ | IOMMU_WRITE)))
- return 0;
+ goto out_err;
prot = arm_lpae_prot_to_pte(data, iommu_prot);