Commit 322a9bbb authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Will Deacon

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: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 935d43ba
...@@ -3632,7 +3632,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev) ...@@ -3632,7 +3632,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
/* Base address */ /* Base address */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 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); dev_err(dev, "MMIO region too small (%pr)\n", res);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment