From: Alok Tiwari Date: Fri, 27 Feb 2026 03:06:53 +0000 (-0800) Subject: PCI: endpoint: Propagate error from pci_epf_create() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b74f7d72399d4c4422ed3d68ef28b3612f71e74;p=thirdparty%2Fkernel%2Flinux.git PCI: endpoint: Propagate error from pci_epf_create() pci_epf_make() overwrites the actual error returned by pci_epf_create() with -EINVAL, which hides the real failure reason. Use PTR_ERR(epf) instead and print the error code. Signed-off-by: Alok Tiwari Signed-off-by: Manivannan Sadhasivam Link: https://patch.msgid.link/20260227030701.40533-1-alok.a.tiwari@oracle.com --- diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c index 653ffc72dd39f..076d115db02b3 100644 --- a/drivers/pci/endpoint/pci-ep-cfs.c +++ b/drivers/pci/endpoint/pci-ep-cfs.c @@ -624,8 +624,8 @@ static struct config_group *pci_epf_make(struct config_group *group, epf = pci_epf_create(epf_name); if (IS_ERR(epf)) { - pr_err("failed to create endpoint function device\n"); - err = -EINVAL; + err = PTR_ERR(epf); + pr_err("failed to create endpoint function device: %d\n", err); goto free_name; }