[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191226095056.30256-1-yamada.masahiro@socionext.com>
Date: Thu, 26 Dec 2019 18:50:56 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
linux-arm-kernel@...ts.infradead.org,
Joerg Roedel <joro@...tes.org>,
iommu@...ts.linux-foundation.org
Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] iommu/arm-smmu-v3: fix resource_size check
This is an off-by-one mistake.
resource_size() returns res->end - res->start + 1.
Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
---
drivers/iommu/arm-smmu-v3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index d9e0d9c19b4f..b463599559d2 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -3599,7 +3599,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;
}
--
2.17.1
Powered by blists - more mailing lists