mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
cpufreq: mediatek: Fix NULL pointer dereference in mediatek-cpufreq
Fix following coccicheck error: drivers/cpufreq/mediatek-cpufreq.c:464:16-23: ERROR: info is NULL but dereferenced. Use pr_err instead of dev_err to avoid dereferring a NULL pointer. Fixes: f52b16ba9fe4 ("cpufreq: mediatek: Use device print to show logs") Signed-off-by: Wan Jiabing <wanjiabing@vivo.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
parent
ffa7bdf7f3
commit
a3b8d1b12c
1 changed files with 2 additions and 2 deletions
|
@ -461,8 +461,8 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy)
|
||||||
|
|
||||||
info = mtk_cpu_dvfs_info_lookup(policy->cpu);
|
info = mtk_cpu_dvfs_info_lookup(policy->cpu);
|
||||||
if (!info) {
|
if (!info) {
|
||||||
dev_err(info->cpu_dev,
|
pr_err("dvfs info for cpu%d is not initialized.\n",
|
||||||
"dvfs info for cpu%d is not initialized.\n", policy->cpu);
|
policy->cpu);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue