thermal/drivers/tegra: Fix crash when getting critical temp
Subsystems (2)
Jon Hunter
maintainerPATCH 1/1 thermal/drivers/tegra: Fix crash when getting critical temp
Commit 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()") removed the function of_thermal_get_crit_temp() and this is causing a NULL pointer deference crash when attempting to call the 'get_crit_temp' function pointer because this function pointer is no longer initialised. Fix this by replacing the call to the 'get_crit_temp' function pointer with a call to the function thermal_zone_get_crit_temp() instead.
--- drivers/thermal/tegra/soctherm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/tegra/soctherm.c +1 -1
@@ -742,7 +742,7 @@ static int tegra_soctherm_set_hwtrips(struct device *dev,/* Get thermtrips. If missing, try to get critical trips. */ temperature =tsensor_group_thermtrip_get (ts, sg->id);if (min_low_temp == temperature) -if (tz->ops->get_crit_temp (tz, &temperature)) +if (thermal_zone_get_crit_temp (tz, &temperature)) temperature = max_high_temp; ret =thermtrip_program (dev, sg, temperature);
Signature · 1 line
2.25.1
Jon Hunter
maintainerHi Rafael,
Quoted 18 lines · Jon Hunter
Commit
13bea86623be("thermal/of: Removeof_thermal_get_crit_temp()") removed the functionof_thermal_get_crit_temp()and this is causing a NULL pointer deference crash when attempting to call the 'get_crit_temp' function pointer because this function pointer is no longer initialised. Fix this by replacing the call to the 'get_crit_temp' function pointer with a call to the functionthermal_zone_get_crit_temp()instead.Fixes 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")Signed-off-by Jon Hunter <[email protected]>--- drivers/thermal/tegra/soctherm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/tegra/soctherm.c +0
-0
drivers/thermal/tegra/soctherm.c static int tegra_soctherm_set_hwtrips(struct device *dev, · line 748
Quoted 8 lines
drivers/thermal/tegra/soctherm.c +1
-1@@ -742,7 +742,7 @@ static int tegra_soctherm_set_hwtrips(struct device *dev,/* Get thermtrips. If missing, try to get critical trips. */ temperature =tsensor_group_thermtrip_get (ts, sg->id);if (min_low_temp == temperature) -if (tz->ops->get_crit_temp (tz, &temperature)) +if (thermal_zone_get_crit_temp (tz, &temperature)) temperature = max_high_temp; ret =thermtrip_program (dev, sg, temperature);
Any feedback on this? OK to take this fix?
Thanks
Jon
Signature · 1 line
nvpublic
Quoted 16 lines · Jon Hunter
Hi Rafael,
Quoted 13 lines · Jon Hunter
Commit
13bea86623be("thermal/of: Removeof_thermal_get_crit_temp()") removed the functionof_thermal_get_crit_temp()and this is causing a NULL pointer deference crash when attempting to call the 'get_crit_temp' function pointer because this function pointer is no longer initialised. Fix this by replacing the call to the 'get_crit_temp' function pointer with a call to the functionthermal_zone_get_crit_temp()instead.Fixes 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")Signed-off-by Jon Hunter <[email protected]>---
drivers/thermal/tegra/soctherm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
drivers/thermal/tegra/soctherm.c static int tegra_soctherm_set_hwtrips(struct · line 748
Quoted 13 lines
drivers/thermal/tegra/soctherm.c +1
-1@@ -742,7 +742,7 @@ static int tegra_soctherm_set_hwtrips(structdevice *dev, /* Get thermtrips. If missing, try to get critical trips. */ temperature = tsensor_group_thermtrip_get(ts, sg->id); if (min_low_temp == temperature) - if (tz->ops->get_crit_temp(tz, &temperature)) + if (thermal_zone_get_crit_temp(tz, &temperature)) temperature = max_high_temp; ret = thermtrip_program(dev, sg, temperature);
I'll take it
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Daniel Lezcano
AppliedQuoted 10 lines · Jon Hunter
Commit
13bea86623be("thermal/of: Removeof_thermal_get_crit_temp()") removed the functionof_thermal_get_crit_temp()and this is causing a NULL pointer deference crash when attempting to call the 'get_crit_temp' function pointer because this function pointer is no longer initialised. Fix this by replacing the call to the 'get_crit_temp' function pointer with a call to the functionthermal_zone_get_crit_temp()instead.Fixes 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")Signed-off-by Jon Hunter <[email protected]>---
Applied, thanks
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
The following commit has been merged into the thermal/next branch of thermal:
The following commit has been merged into the thermal/next branch of thermal:
Commit-ID: 340e74d08972239f8ec6ad3bed706b360162f293 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//340e74d08972239f8ec6ad3bed706b360162f293 Author: Jon Hunter <[email protected]> AuthorDate: Mon, 10 Oct 2022 16:03:11 +01:00 Committer: Daniel Lezcano <[email protected]> CommitterDate: Thu, 08 Dec 2022 14:30:43 +01:00
thermal/drivers/tegra: Fix crash when getting critical temp
Commit 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()") removed the function of_thermal_get_crit_temp() and this is causing a NULL pointer deference crash when attempting to call the 'get_crit_temp' function pointer because this function pointer is no longer initialised. Fix this by replacing the call to the 'get_crit_temp' function pointer with a call to the function thermal_zone_get_crit_temp() instead.
--- drivers/thermal/tegra/soctherm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/tegra/soctherm.c +1 -1
@@ -742,7 +742,7 @@ static int tegra_soctherm_set_hwtrips(struct device *dev,/* Get thermtrips. If missing, try to get critical trips. */ temperature =tsensor_group_thermtrip_get (ts, sg->id);if (min_low_temp == temperature) -if (tz->ops->get_crit_temp (tz, &temperature)) +if (thermal_zone_get_crit_temp (tz, &temperature)) temperature = max_high_temp; ret =thermtrip_program (dev, sg, temperature);