From: "Krzysztof Wilczyński" <kw@linux.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>,
Rob Herring <robh@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Michal Simek <michal.simek@amd.com>,
Thippeswamy Havalige <thippeswamy.havalige@amd.com>,
Bharat Kumar Gogada <bharat.kumar.gogada@amd.com>,
linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dan.carpenter@linaro.org,
kernel-janitors@vger.kernel.org, error27@gmail.com
Subject: Re: [PATCH next] PCI: xilinx-xdma: Fix error code in xilinx_pl_dma_pcie_init_irq_domain()
Date: Sat, 6 Jan 2024 20:39:23 +0900 [thread overview]
Message-ID: <20240106113923.GA3450972@rocinante> (raw)
In-Reply-To: <20231030072757.3236546-1-harshit.m.mogalapalli@oracle.com>
Hello,
> Return -ENOMEM instead of zero(success) when it fails to get IRQ domain.
>
> Fixes: 8d786149d78c ("PCI: xilinx-xdma: Add Xilinx XDMA Root Port driver")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> This is found with smatch and the patch is only compile tested.
> ---
> drivers/pci/controller/pcie-xilinx-dma-pl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pcie-xilinx-dma-pl.c b/drivers/pci/controller/pcie-xilinx-dma-pl.c
> index 2f7d676c683c..52f3211d11cd 100644
> --- a/drivers/pci/controller/pcie-xilinx-dma-pl.c
> +++ b/drivers/pci/controller/pcie-xilinx-dma-pl.c
> @@ -576,7 +576,7 @@ static int xilinx_pl_dma_pcie_init_irq_domain(struct pl_dma_pcie *port)
> &intx_domain_ops, port);
> if (!port->intx_domain) {
> dev_err(dev, "Failed to get a INTx IRQ domain\n");
> - return PTR_ERR(port->intx_domain);
> + return -ENOMEM;
> }
This looks good.
However, there is probably another issue here on the failure path. I don't
see any of_node_put() to release the pcie_intc_node taken at the top of the
xilinx_pl_dma_pcie_init_irq_domain() function.
I would imagine a similar approach to the error handling as what we can see
from xilinx_cpm_pcie_init_irq_domain() function in the older driver.
Thippeswamy, can you have a look and see if this can be improved? I would
love to get a fix before Bjorn sends a Pull Request for the next release.
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-01-06 11:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 7:27 [PATCH next] PCI: xilinx-xdma: Fix error code in xilinx_pl_dma_pcie_init_irq_domain() Harshit Mogalapalli
2024-01-06 11:39 ` Krzysztof Wilczyński [this message]
2024-01-08 18:27 ` Krzysztof Wilczyński
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240106113923.GA3450972@rocinante \
--to=kw@linux.com \
--cc=bharat.kumar.gogada@amd.com \
--cc=bhelgaas@google.com \
--cc=dan.carpenter@linaro.org \
--cc=error27@gmail.com \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=michal.simek@amd.com \
--cc=robh@kernel.org \
--cc=thippeswamy.havalige@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox