mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider()
@ 2023-11-17  7:49 Alexandra Diupina
  2023-11-17 11:14 ` Александра Дюпина
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandra Diupina @ 2023-11-17  7:49 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Alexandra Diupina, Cristian Marussi, Rafael J. Wysocki,
	Viresh Kumar, linux-arm-kernel, linux-pm, linux-kernel,
	lvc-project

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: 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider")
Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
---
 drivers/cpufreq/scmi-cpufreq.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index c8a7ccc42c16..4037945663bf 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -334,8 +334,13 @@ 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) {
+			dev_err(dev, "%s: registering clock provider failed, err: %d\n",
+				__func__, ret);
+		}
+	}
 #endif
 
 	ret = cpufreq_register_driver(&scmi_cpufreq_driver);
-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-06  6:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-17  7:49 [PATCH] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() Alexandra Diupina
2023-11-17 11:14 ` Александра Дюпина
2023-11-18  7:00   ` Christophe JAILLET
2023-12-05 15:12     ` [PATCH v2] " Alexandra Diupina
2023-12-06  6:11       ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®