Skip to content

Commit a1c3063

Browse files
dlezcanoDaniel Lezcano
authored andcommitted
thermal/drivers/exynos: Fix NULL pointer dereference when getting the critical temp
The driver is assuming the get_critical temperature exists as it is inherited by the thermal of ops. But this one has been removed in favor of the generic one. Use the generic thermal_zone_get_crit_temp() function instead Fixes: 13bea86 ("thermal/of: Remove of_thermal_get_crit_temp(") Reported-by: Marek Szyprowski <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
1 parent d3ecaf1 commit a1c3063

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/thermal/samsung/exynos_tmu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,8 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
264264
unsigned int status;
265265
int ret = 0, temp;
266266

267-
if (data->soc != SOC_ARCH_EXYNOS5433) /* FIXME */
268-
ret = tzd->ops->get_crit_temp(tzd, &temp);
269-
if (ret) {
267+
ret = thermal_zone_get_crit_temp(tzd, &temp);
268+
if (ret && data->soc != SOC_ARCH_EXYNOS5433) { /* FIXME */
270269
dev_err(&pdev->dev,
271270
"No CRITICAL trip point defined in device tree!\n");
272271
goto out;

0 commit comments

Comments
 (0)