public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Pramod Gurav <pramod.gurav@smartplayin.com>
Cc: linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH] mfd: db8500-prcmu: check return of devm_ioremap for error
Date: Mon, 3 Nov 2014 16:05:52 +0000	[thread overview]
Message-ID: <20141103160552.GD10544@x1> (raw)
In-Reply-To: <1414660895-29255-1-git-send-email-pramod.gurav@smartplayin.com>

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.walleij@linaro.org>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Pramod Gurav <pramod.gurav@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

  parent reply	other threads:[~2014-11-03 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30  9:21 [PATCH] mfd: db8500-prcmu: check return of devm_ioremap for error Pramod Gurav
2014-10-31 21:11 ` Linus Walleij
2014-11-03 16:05 ` Lee Jones [this message]
2014-11-03 16:45   ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141103160552.GD10544@x1 \
    --to=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pramod.gurav@smartplayin.com \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox