* [PATCH] iommu: exynos: Fix out of bound array access
@ 2013-03-28 6:19 Axel Lin
0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2013-03-28 6:19 UTC (permalink / raw)
To: Kukjin Kim; +Cc: Joerg Roedel, KyongHo Cho, linux-kernel
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].
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/iommu/exynos-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 238a3ca..de04e6a 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -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)
--
1.7.10.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-03-28 6:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 6:19 [PATCH] iommu: exynos: Fix out of bound array access Axel Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.