* [PATCH] phy: qcom: Fix ret is uninitialised
@ 2025-08-06 16:55 Andrew Goodbody
2025-08-11 6:18 ` Sumit Garg
2025-08-18 10:31 ` Casey Connolly
0 siblings, 2 replies; 3+ messages in thread
From: Andrew Goodbody @ 2025-08-06 16:55 UTC (permalink / raw)
To: Casey Connolly, Neil Armstrong, Sumit Garg, Tom Rini
Cc: u-boot-qcom, u-boot, Andrew Goodbody
In qcom_snps_eusb2_phy_probe after the call to devm_clk_get if an error
is found then ret is printed but has not been assigned to by the code.
Decode the error from the pointer and assign it to ret.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
---
drivers/phy/qcom/phy-qcom-snps-eusb2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/qcom/phy-qcom-snps-eusb2.c b/drivers/phy/qcom/phy-qcom-snps-eusb2.c
index b2655ac007c..28502c46f67 100644
--- a/drivers/phy/qcom/phy-qcom-snps-eusb2.c
+++ b/drivers/phy/qcom/phy-qcom-snps-eusb2.c
@@ -331,8 +331,9 @@ static int qcom_snps_eusb2_phy_probe(struct udevice *dev)
qcom_snps_eusb2->ref_clk = devm_clk_get(dev, "ref");
if (IS_ERR(qcom_snps_eusb2->ref_clk)) {
+ ret = PTR_ERR(qcom_snps_eusb2->ref_clk);
printf("%s: failed to get ref clk %d\n", __func__, ret);
- return PTR_ERR(qcom_snps_eusb2->ref_clk);
+ return ret;
}
ret = reset_get_bulk(dev, &qcom_snps_eusb2->resets);
---
base-commit: 007610da2cca405ea7739fc120d90085be4b6ac2
change-id: 20250806-phy_qcom_snps-3134f2c95276
Best regards,
--
Andrew Goodbody <andrew.goodbody@linaro.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] phy: qcom: Fix ret is uninitialised
2025-08-06 16:55 [PATCH] phy: qcom: Fix ret is uninitialised Andrew Goodbody
@ 2025-08-11 6:18 ` Sumit Garg
2025-08-18 10:31 ` Casey Connolly
1 sibling, 0 replies; 3+ messages in thread
From: Sumit Garg @ 2025-08-11 6:18 UTC (permalink / raw)
To: Andrew Goodbody
Cc: Casey Connolly, Neil Armstrong, Tom Rini, u-boot-qcom, u-boot
On Wed, Aug 06, 2025 at 05:55:04PM +0100, Andrew Goodbody wrote:
> In qcom_snps_eusb2_phy_probe after the call to devm_clk_get if an error
> is found then ret is printed but has not been assigned to by the code.
> Decode the error from the pointer and assign it to ret.
>
> This issue was found by Smatch.
>
> Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
> ---
> drivers/phy/qcom/phy-qcom-snps-eusb2.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
-Sumit
>
> diff --git a/drivers/phy/qcom/phy-qcom-snps-eusb2.c b/drivers/phy/qcom/phy-qcom-snps-eusb2.c
> index b2655ac007c..28502c46f67 100644
> --- a/drivers/phy/qcom/phy-qcom-snps-eusb2.c
> +++ b/drivers/phy/qcom/phy-qcom-snps-eusb2.c
> @@ -331,8 +331,9 @@ static int qcom_snps_eusb2_phy_probe(struct udevice *dev)
>
> qcom_snps_eusb2->ref_clk = devm_clk_get(dev, "ref");
> if (IS_ERR(qcom_snps_eusb2->ref_clk)) {
> + ret = PTR_ERR(qcom_snps_eusb2->ref_clk);
> printf("%s: failed to get ref clk %d\n", __func__, ret);
> - return PTR_ERR(qcom_snps_eusb2->ref_clk);
> + return ret;
> }
>
> ret = reset_get_bulk(dev, &qcom_snps_eusb2->resets);
>
> ---
> base-commit: 007610da2cca405ea7739fc120d90085be4b6ac2
> change-id: 20250806-phy_qcom_snps-3134f2c95276
>
> Best regards,
> --
> Andrew Goodbody <andrew.goodbody@linaro.org>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] phy: qcom: Fix ret is uninitialised
2025-08-06 16:55 [PATCH] phy: qcom: Fix ret is uninitialised Andrew Goodbody
2025-08-11 6:18 ` Sumit Garg
@ 2025-08-18 10:31 ` Casey Connolly
1 sibling, 0 replies; 3+ messages in thread
From: Casey Connolly @ 2025-08-18 10:31 UTC (permalink / raw)
To: Neil Armstrong, Sumit Garg, Tom Rini, Andrew Goodbody; +Cc: u-boot-qcom, u-boot
On Wed, 06 Aug 2025 17:55:04 +0100, Andrew Goodbody wrote:
> In qcom_snps_eusb2_phy_probe after the call to devm_clk_get if an error
> is found then ret is printed but has not been assigned to by the code.
> Decode the error from the pointer and assign it to ret.
>
> This issue was found by Smatch.
>
>
> [...]
Applied, thanks!
[1/1] phy: qcom: Fix ret is uninitialised
https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/fda7bee6468e
Best regards,
--
// Caleb (they/them)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-18 10:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 16:55 [PATCH] phy: qcom: Fix ret is uninitialised Andrew Goodbody
2025-08-11 6:18 ` Sumit Garg
2025-08-18 10:31 ` Casey Connolly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox