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] [thread-next>] [day] [month] [year] [list]
Message-ID: <cl52jts26ulfcanbzz42w35g3bcjlwfhteph2oze4drveajzg3@a4kq3cxfzn2l>
Date: Mon, 8 Sep 2025 15:43:17 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Xichao Zhao <zhao.xichao@...o.com>
Cc: daire.mcnamara@...rochip.com, lpieralisi@...nel.org, 
	kwilczynski@...nel.org, bhelgaas@...gle.com, robh@...nel.org, linux-pci@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI: plda: Remove the use of dev_err_probe()

On Wed, Aug 20, 2025 at 04:52:00PM GMT, Xichao Zhao wrote:
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
> 

Change is fine as it is. But I think devm_pci_alloc_host_bridge() should return
the actual error pointer instead of NULL and let the callers guess the errno.

Callers are using both -ENOMEM and -ENODEV, both of then will mask the actual
errno that caused the failure.

Cleanup task for someone interested :)

- Mani

> Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
> ---
>  drivers/pci/controller/plda/pcie-plda-host.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/plda/pcie-plda-host.c b/drivers/pci/controller/plda/pcie-plda-host.c
> index 8e2db2e5b64b..3c2f68383010 100644
> --- a/drivers/pci/controller/plda/pcie-plda-host.c
> +++ b/drivers/pci/controller/plda/pcie-plda-host.c
> @@ -599,8 +599,7 @@ int plda_pcie_host_init(struct plda_pcie_rp *port, struct pci_ops *ops,
>  
>  	bridge = devm_pci_alloc_host_bridge(dev, 0);
>  	if (!bridge)
> -		return dev_err_probe(dev, -ENOMEM,
> -				     "failed to alloc bridge\n");
> +		return -ENOMEM;
>  
>  	if (port->host_ops && port->host_ops->host_init) {
>  		ret = port->host_ops->host_init(port);
> -- 
> 2.34.1
> 

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ