From e39dc7e2c9a21575376b572b1e343633a20d8034 Mon Sep 17 00:00:00 2001 From: Hyeonseong Gil Date: Fri, 2 Sep 2016 15:54:52 +0900 Subject: [PATCH] [COMMON] thermal: samsung: Fix SVACE error Avoid to divide by zero Change-Id: Id4479af236878fa8f304c3e8d00f1a4e47c50691 Signed-off-by: Hyeonseong Gil --- drivers/thermal/samsung/exynos_tmu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 : -- 2.20.1