Skip to content

Commit 5f28ecc

Browse files
jonhunterDaniel Lezcano
authored andcommitted
thermal/drivers/tegra: Fix crash when getting critical temp
Commit 13bea86 ("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. Fixes: 13bea86 ("thermal/of: Remove of_thermal_get_crit_temp()") Signed-off-by: Jon Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent a1c3063 commit 5f28ecc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thermal/tegra/soctherm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ static int tegra_soctherm_set_hwtrips(struct device *dev,
742742
/* Get thermtrips. If missing, try to get critical trips. */
743743
temperature = tsensor_group_thermtrip_get(ts, sg->id);
744744
if (min_low_temp == temperature)
745-
if (tz->ops->get_crit_temp(tz, &temperature))
745+
if (thermal_zone_get_crit_temp(tz, &temperature))
746746
temperature = max_high_temp;
747747

748748
ret = thermtrip_program(dev, sg, temperature);

0 commit comments

Comments
 (0)