lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0b8b8cde-d273-442c-8537-3fa95885476b@foss.st.com>
Date: Fri, 5 Sep 2025 17:53:14 +0200
From: Christian Bruel <christian.bruel@...s.st.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
CC: Lorenzo Pieralisi <lpieralisi@...nel.org>,
        Krzysztof WilczyƄski <kwilczynski@...nel.org>,
        "Manivannan
 Sadhasivam" <mani@...nel.org>,
        Rob Herring <robh@...nel.org>, Bjorn Helgaas
	<bhelgaas@...gle.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        "Alexandre Torgue" <alexandre.torgue@...s.st.com>,
        <linux-pci@...r.kernel.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] PCI: stm32: clean up some error handling in probe()



On 9/5/25 10:04, Dan Carpenter wrote:
> Smatch complains that the other error paths use gotos to clean up and
> these two don't.  Generally, the implication with that warning is that
> the error handly has been ommitted.  In this case, the error handling is
> fine, but we can avoid a bit of code duplication by using gotos to clean
> up.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
>   drivers/pci/controller/dwc/pcie-stm32.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-stm32.c b/drivers/pci/controller/dwc/pcie-stm32.c
> index 964fa6f674c8..96a5fb893af4 100644
> --- a/drivers/pci/controller/dwc/pcie-stm32.c
> +++ b/drivers/pci/controller/dwc/pcie-stm32.c
> @@ -287,18 +287,16 @@ static int stm32_pcie_probe(struct platform_device *pdev)
>   
>   	ret = pm_runtime_set_active(dev);
>   	if (ret < 0) {
> -		clk_disable_unprepare(stm32_pcie->clk);
> -		stm32_remove_pcie_port(stm32_pcie);
> -		return dev_err_probe(dev, ret, "Failed to activate runtime PM\n");
> +		dev_err_probe(dev, ret, "Failed to activate runtime PM\n");
> +		goto err_disable_clk;
>   	}
>   
>   	pm_runtime_no_callbacks(dev);
>   
>   	ret = devm_pm_runtime_enable(dev);
>   	if (ret < 0) {
> -		clk_disable_unprepare(stm32_pcie->clk);
> -		stm32_remove_pcie_port(stm32_pcie);
> -		return dev_err_probe(dev, ret, "Failed to enable runtime PM\n");
> +		dev_err_probe(dev, ret, "Failed to enable runtime PM\n");
> +		goto err_disable_clk;
>   	}
>   
>   	ret = dw_pcie_host_init(&stm32_pcie->pci.pp);

Acked-by: Christian Bruel <christian.bruel@...s.st.com>

thank you

Christian




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ