cpufreq: rockchip_big_little: check cpufreq_cpu_get return value
authorHuang, Tao <huangtao@rock-chips.com>
Wed, 29 Apr 2015 01:05:09 +0000 (09:05 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 29 Apr 2015 01:05:09 +0000 (09:05 +0800)
fix panic when cpu up/down

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
drivers/cpufreq/rockchip_big_little.c

index c817d5b11d95400dea69ce07f7a0ff16e85a5689..b333837664f9ca2e32a0ec96c8ee191ec8b34dad 100644 (file)
@@ -196,6 +196,8 @@ static int rockchip_bl_cpufreq_scale_rate_for_dvfs(struct clk *clk,
 
        cur_cluster = clk_node_get_cluster_id(clk);
        policy = cpufreq_cpu_get(cluster_policy_cpu[cur_cluster]);
+       if (!policy)
+               return 0;
 
        freqs.new = rate / 1000;
        freqs.old = clk_get_rate(clk) / 1000;