diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2018-04-26 13:51:30 +0200 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2018-05-06 16:42:05 -0700 |
commit | 89335c203a8d45a9380c9fec4cdc8cda404569ad (patch) | |
tree | ec91cb159906a8a509490f2b1fcaa3843a7ae1dc /drivers/thermal/samsung/exynos_tmu.c | |
parent | c8f8f7682e13d219699f6980cd0ba067f06d0dcf (diff) |
thermal: exynos: check return values of ->get_trip_[temp, hyst] methods
Check return values of ->get_trip_[temp,hyst] methods in
exynos_tmu_initialize().
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal/samsung/exynos_tmu.c')
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 8cb8601a80ca..ff72f71a0078 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -357,19 +357,23 @@ static int exynos_tmu_initialize(struct platform_device *pdev) /* Write temperature code for rising and falling threshold */ for (i = 0; i < ntrips; i++) { /* Write temperature code for rising threshold */ - tzd->ops->get_trip_temp(tzd, i, &temp); + ret = tzd->ops->get_trip_temp(tzd, i, &temp); + if (ret) + goto err; temp /= MCELSIUS; data->tmu_set_trip_temp(data, i, temp); /* Write temperature code for falling threshold */ - tzd->ops->get_trip_hyst(tzd, i, &hyst); + ret = tzd->ops->get_trip_hyst(tzd, i, &hyst); + if (ret) + goto err; hyst /= MCELSIUS; data->tmu_set_trip_hyst(data, i, temp, hyst); } data->tmu_clear_irqs(data); } - +err: clk_disable(data->clk); mutex_unlock(&data->lock); if (!IS_ERR(data->clk_sec)) |