Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3435e4d9 authored by Prakash Gupta's avatar Prakash Gupta Committed by Gerrit - the friendly Code Review server
Browse files

iommu/arm-smmu: Add NULL check for platform_get_resource return value



platform_get_resource return value 'res' can be NULL. NULL check
platform_get_resource return value before derefereing.

Change-Id: Ifba91104428c5279fad21f892840c67ce4258aee
Signed-off-by: default avatarPrakash Gupta <guptap@codeaurora.org>
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent 4a3ab87a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4391,7 +4391,11 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
		smmu->features |= ARM_SMMU_FEAT_COHERENT_WALK;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (res)
	if (res == NULL) {
		dev_err(dev, "no MEM resource info\n");
		return -EINVAL;
	}

	smmu->phys_addr = res->start;
	smmu->base = devm_ioremap_resource(dev, res);
	if (IS_ERR(smmu->base))