summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-12-26 18:50:56 +0900
committerWill Deacon <will@kernel.org>2020-01-10 09:49:27 +0000
commit322a9bbb720cd273d2967a375d1887199b361528 (patch)
tree0f02ef4cd8fa37b24bb84e47a38450872f28c51f
parent935d43ba272e0001f8ef446a3eff15d8175cb11b (diff)
iommu/arm-smmu-v3: Fix resource_size check
This is an off-by-one mistake. resource_size() returns res->end - res->start + 1. Reviewed-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--drivers/iommu/arm-smmu-v3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index a4ee956b8968..5c42c686cffe 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -3632,7 +3632,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
/* Base address */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (resource_size(res) + 1 < arm_smmu_resource_size(smmu)) {
+ if (resource_size(res) < arm_smmu_resource_size(smmu)) {
dev_err(dev, "MMIO region too small (%pr)\n", res);
return -EINVAL;
}