cpufreq: exynos5440: Fix potential NULL pointer dereference
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 18 Sep 2013 05:14:53 +0000 (10:44 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 25 Sep 2013 01:25:58 +0000 (03:25 +0200)
If 'dvfs_info' is NULL (due to devm_kzalloc failure) the failure
error message would try to dereference it. Use 'pdev' instead.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/exynos5440-cpufreq.c

index d514c15..be5380e 100644 (file)
@@ -457,7 +457,7 @@ err_free_table:
        opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table);
 err_put_node:
        of_node_put(np);
-       dev_err(dvfs_info->dev, "%s: failed initialization\n", __func__);
+       dev_err(&pdev->dev, "%s: failed initialization\n", __func__);
        return ret;
 }