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

Commit 51a7e02b authored by Pramod Gurav's avatar Pramod Gurav Committed by Lee Jones
Browse files

mfd: db8500-prcmu: Check return of devm_ioremap for error



Error check around return value of devm_ioremap is missing. Add the same
to avoid NULL pointer dereference.

Signed-off-by: default avatarPramod Gurav <pramod.gurav@smartplayin.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 1b9b46d0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3167,6 +3167,11 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
	}
	tcdm_base = devm_ioremap(&pdev->dev, res->start,
			resource_size(res));
	if (!tcdm_base) {
		dev_err(&pdev->dev,
			"failed to ioremap prcmu-tcdm register memory\n");
		return -ENOENT;
	}

	/* Clean up the mailbox interrupts after pre-kernel code. */
	writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);