linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem()
@ 2024-12-02  9:07 Dan Carpenter
  2024-12-08 12:44 ` Manivannan Sadhasivam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2024-12-02  9:07 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
	linux-pci, linux-rockchip, linux-arm-kernel, linux-kernel,
	kernel-janitors

Return -ENOMEM if pci_epc_mem_alloc_addr() fails.  Don't return success.

Fixes: 945648019466 ("PCI: rockchip-ep: Refactor rockchip_pcie_ep_probe() memory allocations")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
---
v2: Update the git hash for the Fixes tag because the tree was rebased I guess.

 drivers/pci/controller/pcie-rockchip-ep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
index 1064b7b06cef..34162ca14093 100644
--- a/drivers/pci/controller/pcie-rockchip-ep.c
+++ b/drivers/pci/controller/pcie-rockchip-ep.c
@@ -784,6 +784,7 @@ static int rockchip_pcie_ep_init_ob_mem(struct rockchip_pcie_ep *ep)
 						  SZ_1M);
 	if (!ep->irq_cpu_addr) {
 		dev_err(dev, "failed to reserve memory space for MSI\n");
+		err = -ENOMEM;
 		goto err_epc_mem_exit;
 	}
 
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem()
  2024-12-02  9:07 [PATCH v2] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem() Dan Carpenter
@ 2024-12-08 12:44 ` Manivannan Sadhasivam
  2024-12-12  9:43 ` Niklas Cassel
  2025-01-15 11:31 ` Krzysztof Wilczyński
  2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2024-12-08 12:44 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Damien Le Moal, Shawn Lin, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
	Heiko Stuebner, linux-pci, linux-rockchip, linux-arm-kernel,
	linux-kernel, kernel-janitors

On Mon, Dec 02, 2024 at 12:07:22PM +0300, Dan Carpenter wrote:
> Return -ENOMEM if pci_epc_mem_alloc_addr() fails.  Don't return success.
> 
> Fixes: 945648019466 ("PCI: rockchip-ep: Refactor rockchip_pcie_ep_probe() memory allocations")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

- Mani

> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> ---
> v2: Update the git hash for the Fixes tag because the tree was rebased I guess.
> 
>  drivers/pci/controller/pcie-rockchip-ep.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
> index 1064b7b06cef..34162ca14093 100644
> --- a/drivers/pci/controller/pcie-rockchip-ep.c
> +++ b/drivers/pci/controller/pcie-rockchip-ep.c
> @@ -784,6 +784,7 @@ static int rockchip_pcie_ep_init_ob_mem(struct rockchip_pcie_ep *ep)
>  						  SZ_1M);
>  	if (!ep->irq_cpu_addr) {
>  		dev_err(dev, "failed to reserve memory space for MSI\n");
> +		err = -ENOMEM;
>  		goto err_epc_mem_exit;
>  	}
>  
> -- 
> 2.45.2
> 

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem()
  2024-12-02  9:07 [PATCH v2] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem() Dan Carpenter
  2024-12-08 12:44 ` Manivannan Sadhasivam
@ 2024-12-12  9:43 ` Niklas Cassel
  2025-01-15 11:31 ` Krzysztof Wilczyński
  2 siblings, 0 replies; 4+ messages in thread
From: Niklas Cassel @ 2024-12-12  9:43 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Damien Le Moal, Shawn Lin, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
	Bjorn Helgaas, Heiko Stuebner, linux-pci, linux-rockchip,
	linux-arm-kernel, linux-kernel, kernel-janitors

On Mon, Dec 02, 2024 at 12:07:22PM +0300, Dan Carpenter wrote:
> Return -ENOMEM if pci_epc_mem_alloc_addr() fails.  Don't return success.
> 
> Fixes: 945648019466 ("PCI: rockchip-ep: Refactor rockchip_pcie_ep_probe() memory allocations")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> ---
> v2: Update the git hash for the Fixes tag because the tree was rebased I guess.
> 
>  drivers/pci/controller/pcie-rockchip-ep.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
> index 1064b7b06cef..34162ca14093 100644
> --- a/drivers/pci/controller/pcie-rockchip-ep.c
> +++ b/drivers/pci/controller/pcie-rockchip-ep.c
> @@ -784,6 +784,7 @@ static int rockchip_pcie_ep_init_ob_mem(struct rockchip_pcie_ep *ep)
>  						  SZ_1M);
>  	if (!ep->irq_cpu_addr) {
>  		dev_err(dev, "failed to reserve memory space for MSI\n");
> +		err = -ENOMEM;
>  		goto err_epc_mem_exit;
>  	}
>  
> -- 
> 2.45.2
> 

Reviewed-by: Niklas Cassel <cassel@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem()
  2024-12-02  9:07 [PATCH v2] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem() Dan Carpenter
  2024-12-08 12:44 ` Manivannan Sadhasivam
  2024-12-12  9:43 ` Niklas Cassel
@ 2025-01-15 11:31 ` Krzysztof Wilczyński
  2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Wilczyński @ 2025-01-15 11:31 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Damien Le Moal, Shawn Lin, Lorenzo Pieralisi,
	Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
	linux-pci, linux-rockchip, linux-arm-kernel, linux-kernel,
	kernel-janitors

Hello,

> Return -ENOMEM if pci_epc_mem_alloc_addr() fails.  Don't return success.

Applied to controller/rockchip for v6.14, thank you!

Krzysztof


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-15 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02  9:07 [PATCH v2] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem() Dan Carpenter
2024-12-08 12:44 ` Manivannan Sadhasivam
2024-12-12  9:43 ` Niklas Cassel
2025-01-15 11:31 ` Krzysztof Wilczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).