From: Hyeonseong Gil Date: Fri, 17 Feb 2017 08:14:31 +0000 (+0900) Subject: [COMMON] thermal: cpu_cooling: Fix Prevent CID 11693 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bed9f0df9ca486b86f2680325e097375e4fc889a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] thermal: cpu_cooling: Fix Prevent CID 11693 Change-Id: I9e577d3cfb981910ef001aa90b0bc396f0b2741d Signed-off-by: Hyeonseong Gil --- diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 4ec1cb74e463..6cce65413a75 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -251,6 +251,9 @@ static int build_static_power_table(struct cpufreq_cooling_device *cpufreq_cdev) struct ect_gen_param_table *volt_temp_param, *asv_param; int ratio_table[16] = { 0, 18, 22, 27, 33, 40, 49, 60, 73, 89, 108, 131, 159, 194, 232, 250}; + if (asv_group < 0 || asv_group > 15) + asv_group = 0; + if (!ratio) ratio = ratio_table[asv_group]; diff --git a/drivers/thermal/gpu_cooling.c b/drivers/thermal/gpu_cooling.c index e261b57b84dd..148ea8a0a6d2 100644 --- a/drivers/thermal/gpu_cooling.c +++ b/drivers/thermal/gpu_cooling.c @@ -315,6 +315,9 @@ static int build_static_power_table(struct gpufreq_cooling_device *gpufreq_cdev) struct ect_gen_param_table *volt_temp_param, *asv_param; int ratio_table[16] = { 0, 25, 29, 35, 41, 48, 57, 67, 79, 94, 110, 130, 151, 162, 162, 162}; + if (asv_group < 0 || asv_group > 15) + asv_group = 0; + if (!ratio) ratio = ratio_table[asv_group];