mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
cpufreq: qcom-hw: Add missing null pointer check
of_device_get_match_data() may return NULL, so add a check to prevent
potential null pointer dereference.
Issue reported by Qualcomm's internal static analysis tool.
Fixes: 4f7961706c
("cpufreq: qcom-hw: Move soc_data to struct qcom_cpufreq")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
ceaa837f96
commit
6f098cde9d
@ -706,6 +706,8 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
qcom_cpufreq.soc_data = of_device_get_match_data(dev);
|
||||
if (!qcom_cpufreq.soc_data)
|
||||
return -ENODEV;
|
||||
|
||||
clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, num_domains), GFP_KERNEL);
|
||||
if (!clk_data)
|
||||
|
Loading…
Reference in New Issue
Block a user