[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231117074911.14427-1-adiupina@astralinux.ru>
Date: Fri, 17 Nov 2023 10:49:11 +0300
From: Alexandra Diupina <adiupina@...ralinux.ru>
To: Sudeep Holla <sudeep.holla@....com>
Cc: Alexandra Diupina <adiupina@...ralinux.ru>,
Cristian Marussi <cristian.marussi@....com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
linux-arm-kernel@...ts.infradead.org, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org
Subject: [PATCH] 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: 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider")
Signed-off-by: Alexandra Diupina <adiupina@...ralinux.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
Powered by blists - more mailing lists