Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg()

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>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/aIzCdV8jyBeql-Oa@stanley.mountain

authored by

Dan Carpenter and committed by
Manivannan Sadhasivam
57a75fa9 8f5ae30d

+1 -1
+1 -1
drivers/pci/endpoint/pci-ep-msi.c
··· 24 24 struct pci_epf *epf; 25 25 26 26 epc = pci_epc_get(dev_name(msi_desc_to_dev(desc))); 27 - if (!epc) 27 + if (IS_ERR(epc)) 28 28 return; 29 29 30 30 epf = list_first_entry_or_null(&epc->pci_epf, struct pci_epf, list);