Skip to contentSkip to conversation

iommu: exynos: Fix out of bound array access

PATCH New Axel Lin 1 participant 1 message Mar 28, 2013

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 iommu: exynos: Fix out of bound array access

In the case of no-match in "for (i = 0; i < (pdev->num_resources / 2); i++)", i is "pdev->num_resources / 2". Fix the boundary checking to avoid the out of bound array access for data->sfrbases[i].

---
 drivers/iommu/exynos-iommu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/exynos-iommu.c +1 -1
index 238a3ca..de04e6a 100644
@@ -357,7 +357,7 @@ static irqreturn_t exynos_sysmmu_irq(int irq, void *dev_id)
 			break;
 	}
 
-	if (i == pdev->num_resources) {
+	if (i == pdev->num_resources / 2) {
 		itype = SYSMMU_FAULT_UNKNOWN;
 	} else {
 		itype = (enum exynos_sysmmu_inttype)
Signature · 1 line
1.7.10.4