[PATCH] thermal: Fix NULL pointer dereference issue

2020-11-16 Thread Mukesh Ojha
Cooling stats variable inside thermal_cooling_device_stats_update() can get NULL. We should add a NULL check on stat inside for sanity. Signed-off-by: Mukesh Ojha --- drivers/thermal/thermal_sysfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/

Re: [PATCH] thermal: Fix NULL pointer dereference issue

2020-11-16 Thread Zhang Rui
On Mon, 2020-11-16 at 21:59 +0530, Mukesh Ojha wrote: > Cooling stats variable inside thermal_cooling_device_stats_update() > can get NULL. We should add a NULL check on stat inside for sanity. > > Signed-off-by: Mukesh Ojha > --- > drivers/thermal/thermal_sysfs.c | 3 +++ > 1 file changed, 3 in

Re: [PATCH] thermal: Fix NULL pointer dereference issue

2020-11-17 Thread Daniel Lezcano
On 17/11/2020 08:18, Zhang Rui wrote: > On Mon, 2020-11-16 at 21:59 +0530, Mukesh Ojha wrote: >> Cooling stats variable inside thermal_cooling_device_stats_update() >> can get NULL. We should add a NULL check on stat inside for sanity. >> >> Signed-off-by: Mukesh Ojha >> --- >> drivers/thermal/th

Re: [PATCH] thermal: Fix NULL pointer dereference issue

2020-11-17 Thread Zhang Rui
On Tue, 2020-11-17 at 09:57 +0100, Daniel Lezcano wrote: > On 17/11/2020 08:18, Zhang Rui wrote: > > On Mon, 2020-11-16 at 21:59 +0530, Mukesh Ojha wrote: > > > Cooling stats variable inside > > > thermal_cooling_device_stats_update() > > > can get NULL. We should add a NULL check on stat inside fo

Re: [PATCH] thermal: Fix NULL pointer dereference issue

2020-11-17 Thread Daniel Lezcano
On 17/11/2020 12:27, Zhang Rui wrote: > On Tue, 2020-11-17 at 09:57 +0100, Daniel Lezcano wrote: >> On 17/11/2020 08:18, Zhang Rui wrote: >>> On Mon, 2020-11-16 at 21:59 +0530, Mukesh Ojha wrote: Cooling stats variable inside thermal_cooling_device_stats_update() can get NULL. We sho