Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1575360

Re: [PATCH] Thermal - Fix possible NULL derefrence.

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Zhang Rui <rui.zhang@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] Thermal - Fix possible NULL derefrence.
Date Tue, 07 Feb 2017 04:40:02 +0100
Message-ID <t84Nk-5In-9@gated-at.bofh.it> (permalink)
References <t5co1-8ip-23@gated-at.bofh.it> <t5co1-8ip-21@gated-at.bofh.it>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.33,344,1477983600"; d="scan'208";a="61984859"
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.18.5.2-0ubuntu3
MIME-Version 1.0
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 36
Organization linux.* mail to news gateway
X-Original-Date Tue, 07 Feb 2017 11:30:13 +0800
X-Original-Message-ID <1486438213.2645.1.camel@intel.com>
X-Original-References <CGME20170130050525epcas1p3686ebf52f0215eef64a358338843305d@epcas1p3.samsung.com> <1485752698-30248-1-git-send-email-shailendra.v@samsung.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1575360

Show key headers only | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] Thermal - Fix possible NULL derefrence. Zhang Rui <rui.zhang@intel.com> - 2017-02-07 04:40 +0100

csiph-web