PCI: endpoint: functions: Fix return value check in pci_epf_test_probe()
Subsystems (2)
PATCH 1/1 PCI: endpoint: functions: Fix return value check in pci_epf_test_probe()
From: Wei Yongjun <[email protected]>
Fix the return value check which testing the wrong variable in pci_epf_test_probe().
Fixes 79ba640e377b ("PCI: endpoint: functions: Add an EP function
to test PCI")
Signed-off-by Wei Yongjun <[email protected]>
--- drivers/pci/endpoint/functions/pci-epf-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-test.c +1 -1
@@ -441,7 +441,7 @@ static int pci_epf_test_probe(struct pci_epf *epf)struct device *dev = &epf->dev; epf_test =devm_kzalloc (dev,sizeof (*epf_test),GFP_KERNEL ); -if (!epf) +if (!epf_test)return -ENOMEM ; epf->header = &test_header;
Bjorn Helgaas
maintainerQuoted 8 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
Fix the return value check which testing the wrong variable in
pci_epf_test_probe().Fixes 79ba640e377b ("PCI: endpoint: functions: Add an EP functionto test PCI")
Signed-off-by Wei Yongjun <[email protected]>
This fix looks obviously correct, so I folded it into the original commit for v4.12. Thanks!
Quoted 18 lines
--- drivers/pci/endpoint/functions/pci-epf-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/endpoint/functions/pci-epf-test.c +1
-1@@ -441,7 +441,7 @@ static int pci_epf_test_probe(struct pci_epf *epf)struct device *dev = &epf->dev; epf_test =devm_kzalloc (dev,sizeof (*epf_test),GFP_KERNEL ); -if (!epf) +if (!epf_test)return -ENOMEM ; epf->header = &test_header;