提交 a1c30637 编写于 作者: D Daniel Lezcano 提交者: Daniel Lezcano

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: 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp(")
Reported-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: NKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
上级 d3ecaf17
......@@ -264,9 +264,8 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
unsigned int status;
int ret = 0, temp;
if (data->soc != SOC_ARCH_EXYNOS5433) /* FIXME */
ret = tzd->ops->get_crit_temp(tzd, &temp);
if (ret) {
ret = thermal_zone_get_crit_temp(tzd, &temp);
if (ret && data->soc != SOC_ARCH_EXYNOS5433) { /* FIXME */
dev_err(&pdev->dev,
"No CRITICAL trip point defined in device tree!\n");
goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册