Skip to content

Commit c4a5118

Browse files
Alexandra Diupinavireshk
authored andcommitted
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: 8410e7f ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider") Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 8f96e29 commit c4a5118

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/cpufreq/scmi-cpufreq.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,11 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev)
334334

335335
#ifdef CONFIG_COMMON_CLK
336336
/* dummy clock provider as needed by OPP if clocks property is used */
337-
if (of_property_present(dev->of_node, "#clock-cells"))
338-
devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
337+
if (of_property_present(dev->of_node, "#clock-cells")) {
338+
ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
339+
if (ret)
340+
return dev_err_probe(dev, ret, "%s: registering clock provider failed\n", __func__);
341+
}
339342
#endif
340343

341344
ret = cpufreq_register_driver(&scmi_cpufreq_driver);

0 commit comments

Comments
 (0)