On Thu, 30 Oct 2014, Pramod Gurav wrote:

> Error check around return value of devm_ioremap is missing. Add the same
> to avoid NULL pointer dereference.
> 
> Cc: Linus Walleij <linus.wall...@linaro.org>
> Cc: Samuel Ortiz <sa...@linux.intel.com>
> Cc: Lee Jones <lee.jo...@linaro.org>
> Signed-off-by: Pramod Gurav <pramod.gu...@smartplayin.com>
> ---
>  drivers/mfd/db8500-prcmu.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
> index 193cf16..89ae8bf 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)
>       }
>       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;

No such file or directory?  I think not.

Changed to -ENOMEM and applied with Linus' Ack.

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

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to