U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: Andrew Goodbody <andrew.goodbody@linaro.org>
Cc: Casey Connolly <casey.connolly@linaro.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Tom Rini <trini@konsulko.com>,
	u-boot-qcom@groups.io, u-boot@lists.denx.de
Subject: Re: [PATCH] phy: qcom: Fix ret is uninitialised
Date: Mon, 11 Aug 2025 11:48:22 +0530	[thread overview]
Message-ID: <aJmLLmHvK7UNBNwF@sumit-X1> (raw)
In-Reply-To: <20250806-phy_qcom_snps-v1-1-5cda830026c7@linaro.org>

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>
> 

  reply	other threads:[~2025-08-11  6:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06 16:55 [PATCH] phy: qcom: Fix ret is uninitialised Andrew Goodbody
2025-08-11  6:18 ` Sumit Garg [this message]
2025-08-18 10:31 ` Casey Connolly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aJmLLmHvK7UNBNwF@sumit-X1 \
    --to=sumit.garg@kernel.org \
    --cc=andrew.goodbody@linaro.org \
    --cc=casey.connolly@linaro.org \
    --cc=neil.armstrong@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox