linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] PCI: endpoint: functions: Fix return value check in pci_epf_test_probe()
@ 2017-04-28  8:55 Wei Yongjun
  2017-04-28 15:25 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2017-04-28  8:55 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Bjorn Helgaas; +Cc: Wei Yongjun, linux-pci

From: Wei Yongjun <weiyongjun1@huawei.com>

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 <weiyongjun1@huawei.com>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index d6a7a12..53fff80 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-28 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-28  8:55 [PATCH -next] PCI: endpoint: functions: Fix return value check in pci_epf_test_probe() Wei Yongjun
2017-04-28 15:25 ` Bjorn Helgaas

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).