rk3188: dvfs: dvfs_adjust_table_lmtvolt determine whether variables are legitimate
authorchenxing <chenxing@rock-chips.com>
Wed, 19 Jun 2013 03:14:52 +0000 (11:14 +0800)
committerchenxing <chenxing@rock-chips.com>
Wed, 19 Jun 2013 03:14:52 +0000 (11:14 +0800)
arch/arm/mach-rk3188/dvfs.c

index 0aab82f67808c5f9c97848e91f43c1e267a9e52c..38ea09e8cc051ac8d2a3ed5aec014838c6b0b199 100755 (executable)
@@ -99,6 +99,10 @@ void dvfs_adjust_table_lmtvolt(struct clk *clk, struct cpufreq_frequency_table *
 {\r
        int i = 0;\r
        unsigned int maxvolt = 0;\r
+       if (IS_ERR(clk) || IS_ERR_OR_NULL(table)) {\r
+               DVFS_ERR("%s: clk error OR table error\n", __func__);\r
+               return ;\r
+       }\r
 \r
        leakage_level = rk_leakage_val();\r
        printk("DVFS MSG: %s: %s get leakage_level = %d\n", clk->name, __func__, leakage_level);\r