[COMMON] thermal: samsung: Fix SVACE error
authorHyeonseong Gil <hs.gil@samsung.com>
Fri, 2 Sep 2016 06:54:52 +0000 (15:54 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:13:26 +0000 (17:13 +0900)
Avoid to divide by zero

Change-Id: Id4479af236878fa8f304c3e8d00f1a4e47c50691
Signed-off-by: Hyeonseong Gil <hs.gil@samsung.com>
drivers/thermal/samsung/exynos_tmu.c

index 59f8cbfac24e772313459580ffbadcf6d02c00b2..78b46d4d4e6415f41a8a14e907c03484db86930b 100644 (file)
@@ -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 :