Commit c4a5118a authored by Alexandra Diupina's avatar Alexandra Diupina Committed by Viresh Kumar

cpufreq: scmi: process the result of devm_of_clk_add_hw_provider()

devm_of_clk_add_hw_provider() may return an errno, so
add a return value check

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 8410e7f3 ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider")
Signed-off-by: default avatarAlexandra Diupina <adiupina@astralinux.ru>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 8f96e29a
......@@ -334,8 +334,11 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev)
#ifdef CONFIG_COMMON_CLK
/* dummy clock provider as needed by OPP if clocks property is used */
if (of_property_present(dev->of_node, "#clock-cells"))
devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
if (of_property_present(dev->of_node, "#clock-cells")) {
ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
if (ret)
return dev_err_probe(dev, ret, "%s: registering clock provider failed\n", __func__);
}
#endif
ret = cpufreq_register_driver(&scmi_cpufreq_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment