public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: LABBE Corentin <clabbe.montjoie@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: qcom_rpm: fix a possible NULL dereference
Date: Tue, 24 Nov 2015 16:46:42 +0000	[thread overview]
Message-ID: <20151124164642.GD12874@x1> (raw)
In-Reply-To: <1447314599-31460-1-git-send-email-clabbe.montjoie@gmail.com>

On Thu, 12 Nov 2015, LABBE Corentin wrote:

> of_match_device could return NULL, and so cause a NULL pointer
> dereference later.
> 
> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
> ---
>  drivers/mfd/qcom_rpm.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

> diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c
> index 207a3bd..1be47ad 100644
> --- a/drivers/mfd/qcom_rpm.c
> +++ b/drivers/mfd/qcom_rpm.c
> @@ -495,6 +495,8 @@ static int qcom_rpm_probe(struct platform_device *pdev)
>  	}
>  
>  	match = of_match_device(qcom_rpm_of_match, &pdev->dev);
> +	if (!match)
> +		return -ENODEV;
>  	rpm->data = match->data;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

      reply	other threads:[~2015-11-24 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12  7:49 [PATCH] mfd: qcom_rpm: fix a possible NULL dereference LABBE Corentin
2015-11-24 16:46 ` Lee Jones [this message]

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=20151124164642.GD12874@x1 \
    --to=lee.jones@linaro.org \
    --cc=clabbe.montjoie@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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