]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: endpoint: Propagate error from pci_epf_create()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Fri, 27 Feb 2026 03:06:53 +0000 (19:06 -0800)
committerManivannan Sadhasivam <mani@kernel.org>
Thu, 5 Mar 2026 06:46:09 +0000 (12:16 +0530)
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 <alok.a.tiwari@oracle.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20260227030701.40533-1-alok.a.tiwari@oracle.com
drivers/pci/endpoint/pci-ep-cfs.c

index 653ffc72dd39f655e1c36b318b7bf2872e607d2f..076d115db02b3f01f173fe344e1a4428d5217c78 100644 (file)
@@ -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;
        }