clk: qcom: Fix missing error check for dev_pm_domain_attach()
Subsystems (3)
PATCH 1/1 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().
--- drivers/clk/qcom/apcs-sdx55.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/clk/qcom/apcs-sdx55.c +5 -1
@@ -111,7 +111,11 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)* driver, there seems to be no better place to do this. So do it here! */ cpu_dev =get_cpu_device (0 ); -dev_pm_domain_attach (cpu_dev, true); + ret =dev_pm_domain_attach (cpu_dev, true); +if (ret) { +dev_err_probe (dev, ret,"can't get PM domain: %d\n" , ret); + goto err; + }return 0 ;
Signature · 1 line
2.42.0.windows.2
…
Quoted 1 line
This patch adds a check for the return value …
How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc2#n145
Regards,
Markus
Quoted 10 lines · Wentao Liang
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 usingdev_err_probe(), and the error is propagated to the existing error handling patherr, which ensures proper cleanup by callingclk_notifier_unregister().[...]
Applied, thanks!
[1/1] clk: qcom: Fix missing error check for dev_pm_domain_attach()
commit: 36eb51ac8bd545b6344c05a9860e4e65ba8d7a62
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>