All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Shailendra Verma <shailendra.v@samsung.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	p.shailesh@samsung.com, ashish.kalra@samsung.com,
	Shailendra Verma <shailendra.capricorn@gmail.com>
Subject: Re: [PATCH] Thermal - Fix possible NULL derefrence.
Date: Tue, 07 Feb 2017 11:30:13 +0800	[thread overview]
Message-ID: <1486438213.2645.1.camel@intel.com> (raw)
In-Reply-To: <1485752698-30248-1-git-send-email-shailendra.v@samsung.com>

Just one comment,
the subject should be 
[PATCH] Thermal: imx_thermal : Fix possible NULL derefrence

On Mon, 2017-01-30 at 10:34 +0530, Shailendra Verma wrote:
> of_device_get_match_data could return NULL, and so can cause
> a NULL pointer dereference later.
> 
> Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>

I think Eduardo will take this patch.

thanks,
rui
> ---
>  drivers/thermal/imx_thermal.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/thermal/imx_thermal.c
> b/drivers/thermal/imx_thermal.c
> index 06912f0..fb648a4 100644
> --- a/drivers/thermal/imx_thermal.c
> +++ b/drivers/thermal/imx_thermal.c
> @@ -489,6 +489,10 @@ static int imx_thermal_probe(struct
> platform_device *pdev)
>  	data->tempmon = map;
>  
>  	data->socdata = of_device_get_match_data(&pdev->dev);
> +	if (!data->socdata) {
> +		dev_err(&pdev->dev, "no device match found\n");
> +		return -ENODEV;
> +	}
>  
>  	/* make sure the IRQ flag is clear before enabling irq on
> i.MX6SX */
>  	if (data->socdata->version == TEMPMON_IMX6SX) {

  reply	other threads:[~2017-02-07  3:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170130050525epcas1p3686ebf52f0215eef64a358338843305d@epcas1p3.samsung.com>
2017-01-30  5:04 ` [PATCH] Thermal - Fix possible NULL derefrence Shailendra Verma
2017-02-07  3:30   ` Zhang Rui [this message]
2017-02-19  1:27     ` Eduardo Valentin

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=1486438213.2645.1.camel@intel.com \
    --to=rui.zhang@intel.com \
    --cc=ashish.kalra@samsung.com \
    --cc=edubezval@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=p.shailesh@samsung.com \
    --cc=shailendra.capricorn@gmail.com \
    --cc=shailendra.v@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.