2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 19:53:59 +08:00

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: Pramod Gurav <pramod.gurav@smartplayin.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
Pramod Gurav 2014-10-30 14:51:35 +05:30 committed by Lee Jones
parent 1b9b46d05f
commit 51a7e02bb6

View File

@ -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);