mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
cpufreq: sti: avoid NULL dereference in dev_err()
ddata.cpu is NULL-checked, then immediately passed to dev_err().
Replace with pr_err() to avoid dereferencing NULL.
Fixes: ab0ea257fc ("cpufreq: st: Provide runtime initialised driver for ST's platforms")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
parent
f0a750dad7
commit
fdbe4cae71
|
|
@ -263,7 +263,7 @@ static int __init sti_cpufreq_init(void)
|
|||
|
||||
ddata.cpu = get_cpu_device(0);
|
||||
if (!ddata.cpu) {
|
||||
dev_err(ddata.cpu, "Failed to get device for CPU0\n");
|
||||
pr_err("Failed to get device for CPU0\n");
|
||||
goto skip_voltage_scaling;
|
||||
}
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ static int __init sti_cpufreq_init(void)
|
|||
goto register_cpufreq_dt;
|
||||
|
||||
skip_voltage_scaling:
|
||||
dev_err(ddata.cpu, "Not doing voltage scaling\n");
|
||||
pr_err("Not doing voltage scaling\n");
|
||||
|
||||
register_cpufreq_dt:
|
||||
platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user