From: Hyeonseong Gil Date: Fri, 2 Sep 2016 06:54:52 +0000 (+0900) Subject: [COMMON] thermal: samsung: Fix SVACE error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e39dc7e2c9a21575376b572b1e343633a20d8034;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] thermal: samsung: Fix SVACE error Avoid to divide by zero Change-Id: Id4479af236878fa8f304c3e8d00f1a4e47c50691 Signed-off-by: Hyeonseong Gil --- diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 59f8cbfac24e..78b46d4d4e64 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -867,7 +867,9 @@ static int exynos8895_tmu_read(struct exynos_tmu_data *data) } switch (data->sensing_mode) { - case AVG : result = result / count; + case AVG : + if (count != 0) + result = result / count; break; case MAX : case MIN :