* [PATCH next] PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg()
@ 2025-08-01 13:34 Dan Carpenter
2025-08-01 16:08 ` Frank Li
2025-08-11 10:59 ` Manivannan Sadhasivam
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-08-01 13:34 UTC (permalink / raw)
To: Frank Li
Cc: Manivannan Sadhasivam, Krzysztof Wilczyński,
Kishon Vijay Abraham I, Bjorn Helgaas, linux-pci, linux-kernel,
kernel-janitors
The pci_epc_get() function returns error pointers. It never returns NULL.
Update the check to match.
Fixes: 1c3b002c6bf6 ("PCI: endpoint: Add RC-to-EP doorbell support using platform MSI controller")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/pci/endpoint/pci-ep-msi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/endpoint/pci-ep-msi.c b/drivers/pci/endpoint/pci-ep-msi.c
index 9ca89cbfec15..1b58357b905f 100644
--- a/drivers/pci/endpoint/pci-ep-msi.c
+++ b/drivers/pci/endpoint/pci-ep-msi.c
@@ -24,7 +24,7 @@ static void pci_epf_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
struct pci_epf *epf;
epc = pci_epc_get(dev_name(msi_desc_to_dev(desc)));
- if (!epc)
+ if (IS_ERR(epc))
return;
epf = list_first_entry_or_null(&epc->pci_epf, struct pci_epf, list);
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH next] PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg()
2025-08-01 13:34 [PATCH next] PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg() Dan Carpenter
@ 2025-08-01 16:08 ` Frank Li
2025-08-11 10:59 ` Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2025-08-01 16:08 UTC (permalink / raw)
To: Dan Carpenter
Cc: Manivannan Sadhasivam, Krzysztof Wilczyński,
Kishon Vijay Abraham I, Bjorn Helgaas, linux-pci, linux-kernel,
kernel-janitors
On Fri, Aug 01, 2025 at 04:34:45PM +0300, Dan Carpenter wrote:
> The pci_epc_get() function returns error pointers. It never returns NULL.
> Update the check to match.
>
> Fixes: 1c3b002c6bf6 ("PCI: endpoint: Add RC-to-EP doorbell support using platform MSI controller")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> drivers/pci/endpoint/pci-ep-msi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/endpoint/pci-ep-msi.c b/drivers/pci/endpoint/pci-ep-msi.c
> index 9ca89cbfec15..1b58357b905f 100644
> --- a/drivers/pci/endpoint/pci-ep-msi.c
> +++ b/drivers/pci/endpoint/pci-ep-msi.c
> @@ -24,7 +24,7 @@ static void pci_epf_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
> struct pci_epf *epf;
>
> epc = pci_epc_get(dev_name(msi_desc_to_dev(desc)));
> - if (!epc)
> + if (IS_ERR(epc))
> return;
>
> epf = list_first_entry_or_null(&epc->pci_epf, struct pci_epf, list);
> --
> 2.47.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH next] PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg()
2025-08-01 13:34 [PATCH next] PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg() Dan Carpenter
2025-08-01 16:08 ` Frank Li
@ 2025-08-11 10:59 ` Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2025-08-11 10:59 UTC (permalink / raw)
To: Frank Li, Dan Carpenter
Cc: Krzysztof Wilczyński, Kishon Vijay Abraham I, Bjorn Helgaas,
linux-pci, linux-kernel, kernel-janitors
On Fri, 01 Aug 2025 16:34:45 +0300, Dan Carpenter wrote:
> The pci_epc_get() function returns error pointers. It never returns NULL.
> Update the check to match.
>
>
Applied, thanks!
[1/1] PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg()
commit: 57a75fa9d56e310e883e4377205690e88c05781b
Best regards,
--
Manivannan Sadhasivam <mani@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-11 10:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01 13:34 [PATCH next] PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg() Dan Carpenter
2025-08-01 16:08 ` Frank Li
2025-08-11 10:59 ` Manivannan Sadhasivam
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).