linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Thermal - Fix possible NULL derefrence.
       [not found] <CGME20170130050525epcas1p3686ebf52f0215eef64a358338843305d@epcas1p3.samsung.com>
@ 2017-01-30  5:04 ` Shailendra Verma
  2017-02-07  3:30   ` Zhang Rui
  0 siblings, 1 reply; 3+ messages in thread
From: Shailendra Verma @ 2017-01-30  5:04 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, linux-pm, linux-kernel, p.shailesh,
	ashish.kalra, Shailendra Verma, Shailendra Verma

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>
---
 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) {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Thermal - Fix possible NULL derefrence.
  2017-01-30  5:04 ` [PATCH] Thermal - Fix possible NULL derefrence Shailendra Verma
@ 2017-02-07  3:30   ` Zhang Rui
  2017-02-19  1:27     ` Eduardo Valentin
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang Rui @ 2017-02-07  3:30 UTC (permalink / raw)
  To: Shailendra Verma, Eduardo Valentin, linux-pm, linux-kernel,
	p.shailesh, ashish.kalra, Shailendra Verma

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) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Thermal - Fix possible NULL derefrence.
  2017-02-07  3:30   ` Zhang Rui
@ 2017-02-19  1:27     ` Eduardo Valentin
  0 siblings, 0 replies; 3+ messages in thread
From: Eduardo Valentin @ 2017-02-19  1:27 UTC (permalink / raw)
  To: Zhang Rui
  Cc: Shailendra Verma, linux-pm, linux-kernel, p.shailesh,
	ashish.kalra, Shailendra Verma

On Tue, Feb 07, 2017 at 11:30:13AM +0800, Zhang Rui wrote:
> Just one comment,
> the subject should be 
> [PATCH] Thermal: imx_thermal : Fix possible NULL derefrence

I fixed the commit title, but I am taking this one

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-19  1:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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
2017-02-19  1:27     ` Eduardo Valentin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).