]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: xilinx-xdma: Fix error code in xilinx_pl_dma_pcie_init_irq_domain()
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Mon, 30 Oct 2023 07:27:57 +0000 (00:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:45:25 +0000 (15:45 -0800)
commitfb1961baa0f46832ea2624b7bf5f01a76535a839
tree47e5f78bdcee55db2b61952e2b958976f77c220b
parent6bb073bcbacf51c06e901322b3fffd8909e9c298
PCI: xilinx-xdma: Fix error code in xilinx_pl_dma_pcie_init_irq_domain()

[ Upstream commit 2324be17b5e05ac682e7c81fcbfc7b36a9b1becb ]

Currently, if the function irq_domain_add_linear() fails to allocate
a new IRQ domain and returns NULL, we would then still return a success
from the xilinx_pl_dma_pcie_init_irq_domain() function regardless, as
the PTR_ERR(NULL) would return a value of zero.  This is not a desirable
outcome.

Thus, fix the incorrect error code and return the -ENOMEM error code if
the irq_domain_add_linear() fails to allocate a new IRQ domain.

[kwilczynski: commit log]
Link: https://lore.kernel.org/linux-pci/20231030072757.3236546-1-harshit.m.mogalapalli@oracle.com
Fixes: 8d786149d78c ("PCI: xilinx-xdma: Add Xilinx XDMA Root Port driver")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/pcie-xilinx-dma-pl.c