[COMMON] thermal: samsung: Fix prevent CID 11979
authorHyeonseong Gil <hs.gil@samsung.com>
Fri, 20 Jan 2017 01:14:07 +0000 (10:14 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:18:24 +0000 (17:18 +0900)
Change-Id: Ief6e4b7e65496a5aad6b51404bbe0987bd3bcf29
Signed-off-by: Hyeonseong Gil <hs.gil@samsung.com>
drivers/thermal/samsung/exynos_tmu.c

index 5767be2e60f1372937ad661d3092f36fcbe59528..3cdcf2c616e91e0aa0c394a8d47d1b36ca96c477 100644 (file)
@@ -1287,7 +1287,7 @@ static int exynos_cpufreq_cooling_register(struct exynos_tmu_data *data)
        cool_np = cooling_spec.np;
 
        for_each_possible_cpu(cpu)
-               if (cpu_topology[cpu].cluster_id == data->id)
+               if (cpu < NR_CPUS && cpu_topology[cpu].cluster_id == data->id)
                        cpumask_copy(&mask_val, topology_core_cpumask(cpu));
 
        if (!of_property_read_string(child, "governor", &governor_name)) {