diff mbox series

[next] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem()

Message ID 8b0fefdf-0e5b-42bb-b1ee-ccdddd13856d@stanley.mountain (mailing list archive)
State New
Headers show
Series [next] PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem() | expand

Commit Message

Dan Carpenter Nov. 30, 2024, 10:01 a.m. UTC
Return -ENOMEM if pci_epc_mem_alloc_addr() fails.  Don't return success.

Fixes: c35a85126116 ("PCI: rockchip-ep: Refactor rockchip_pcie_ep_probe() memory allocations")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/pci/controller/pcie-rockchip-ep.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Damien Le Moal Nov. 30, 2024, 10:28 a.m. UTC | #1
On 11/30/24 19:01, Dan Carpenter wrote:
> Return -ENOMEM if pci_epc_mem_alloc_addr() fails.  Don't return success.
> 
> Fixes: c35a85126116 ("PCI: rockchip-ep: Refactor rockchip_pcie_ep_probe() memory allocations")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Oops. My bad :)

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

Note that this patch is in Linus tree now so the Fixes tag should be:

Fixes: 945648019466 ("PCI: rockchip-ep: Refactor rockchip_pcie_ep_probe() memory
allocations")

Thanks !
diff mbox series

Patch

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