From: Janghyuck Kim Date: Mon, 5 Sep 2016 03:21:20 +0000 (+0900) Subject: [COMMON] iommu/exynos: check condition before pointer access X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=99f2e2e54cd12c1f3a51feb12b14e57486946891;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] iommu/exynos: check condition before pointer access Fix Svace : 64214, 64219 Change-Id: I5ab4d2e84d4a510693978b6aac97ebf8c037119e Signed-off-by: Janghyuck Kim --- diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 6816d48c830f..335068108c34 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -644,6 +644,8 @@ static int __init sysmmu_parse_dt(struct device *sysmmu, switch (prop & WAY_TYPE_MASK) { case _PRIVATE_WAY_ID: + BUG_ON(!priv_id_cfg || priv_id_idx >= priv_id_cnt); + priv_id_cfg[priv_id_idx].cfg = prop & ~WAY_TYPE_MASK; ret = of_property_read_u32_index(sysmmu->of_node, props_name, i+1, &priv_id_cfg[priv_id_idx].id); @@ -655,6 +657,8 @@ static int __init sysmmu_parse_dt(struct device *sysmmu, priv_id_idx++; break; case _PRIVATE_WAY_ADDR: + BUG_ON(!priv_addr_cfg || priv_addr_idx >= priv_addr_cnt); + priv_addr_cfg[priv_addr_idx].cfg = prop & ~WAY_TYPE_MASK; priv_addr_idx++; break;