Skip to content

Commit 36eb51a

Browse files
ISCAS-Vulabandersson
authored andcommitted
clk: qcom: Fix missing error check for dev_pm_domain_attach()
In the current implementation, the return value of dev_pm_domain_attach() is not checked. This can lead to silent failures if the function fails, as the code would continue execution and return 0, ignoring the error. This patch adds a check for the return value of dev_pm_domain_attach(). If the function fails, an error message is logged using dev_err_probe(), and the error is propagated to the existing error handling path `err`, which ensures proper cleanup by calling clk_notifier_unregister(). Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Link: https://lore.kernel.org/r/20250211092017.562-1-vulab@iscas.ac.cn Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 0af2f6b commit 36eb51a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/clk/qcom/apcs-sdx55.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
111111
* driver, there seems to be no better place to do this. So do it here!
112112
*/
113113
cpu_dev = get_cpu_device(0);
114-
dev_pm_domain_attach(cpu_dev, true);
114+
ret = dev_pm_domain_attach(cpu_dev, true);
115+
if (ret) {
116+
dev_err_probe(dev, ret, "can't get PM domain: %d\n", ret);
117+
goto err;
118+
}
115119

116120
return 0;
117121

0 commit comments

Comments
 (0)