diff options
| author | Pramod Gurav <pramod.gurav@smartplayin.com> | 2014-10-30 05:21:35 -0400 |
|---|---|---|
| committer | Lee Jones <lee.jones@linaro.org> | 2014-11-25 11:18:49 -0500 |
| commit | 51a7e02bb629498c32915881ed4fb61ef778282a (patch) | |
| tree | d645c7de99eb01976e84eeed22f5760658732e08 /drivers/mfd | |
| parent | 1b9b46d05f887aec418b3a5f4f55abf79316fcda (diff) | |
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>
Diffstat (limited to 'drivers/mfd')
| -rw-r--r-- | drivers/mfd/db8500-prcmu.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 193cf168ba84..89ae8bf665b4 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
| @@ -3167,6 +3167,11 @@ static int db8500_prcmu_probe(struct platform_device *pdev) | |||
| 3167 | } | 3167 | } |
| 3168 | tcdm_base = devm_ioremap(&pdev->dev, res->start, | 3168 | tcdm_base = devm_ioremap(&pdev->dev, res->start, |
| 3169 | resource_size(res)); | 3169 | resource_size(res)); |
| 3170 | if (!tcdm_base) { | ||
| 3171 | dev_err(&pdev->dev, | ||
| 3172 | "failed to ioremap prcmu-tcdm register memory\n"); | ||
| 3173 | return -ENOENT; | ||
| 3174 | } | ||
| 3170 | 3175 | ||
| 3171 | /* Clean up the mailbox interrupts after pre-kernel code. */ | 3176 | /* Clean up the mailbox interrupts after pre-kernel code. */ |
| 3172 | writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR); | 3177 | writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR); |
