cpufreq: rockchip_big_little: fix panic when topology_physical_package_id return...
authorHuang, Tao <huangtao@rock-chips.com>
Sat, 21 Mar 2015 07:45:52 +0000 (15:45 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Sat, 21 Mar 2015 07:45:52 +0000 (15:45 +0800)
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
drivers/cpufreq/rockchip_big_little.c

index 9eb6b39cdbc32ac679ec92e178287b1f5e097634..c817d5b11d95400dea69ce07f7a0ff16e85a5689 100644 (file)
@@ -95,7 +95,10 @@ static unsigned int big_little = 1;
 /*******************************************************/
 static inline int cpu_to_cluster(int cpu)
 {
-       return topology_physical_package_id(cpu);
+       int id = topology_physical_package_id(cpu);
+       if (id < 0)
+               id = 0;
+       return id;
 }
 
 static unsigned int rockchip_bl_cpufreq_get_rate(unsigned int cpu)