diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-08-01 13:15:25 +0300 |
---|---|---|
committer | Jon Mason <jdmason@kudzu.us> | 2022-08-09 17:54:49 -0400 |
commit | 3305f43cb6a8f1653c31463597d37216d03717c1 (patch) | |
tree | b07312483a801c3f7f2685bbe6b70b15d3bcc394 /drivers/pci | |
parent | ae9f38adac261e4ca83559c7df21b18dd66aa986 (diff) | |
download | linux-stable-3305f43cb6a8f1653c31463597d37216d03717c1.tar.gz linux-stable-3305f43cb6a8f1653c31463597d37216d03717c1.tar.bz2 linux-stable-3305f43cb6a8f1653c31463597d37216d03717c1.zip |
NTB: EPF: Fix error code in epf_ntb_bind()
Return an error code if pci_register_driver() fails. Don't return
success.
Fixes: da51fd247424 ("NTB: EPF: support NTB transfer between PCI RC and EP connection")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/endpoint/functions/pci-epf-vntb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c index 2aee789a370c..a5fa32eab39c 100644 --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c @@ -1321,7 +1321,8 @@ static int epf_ntb_bind(struct pci_epf *epf) pci_vntb_table[0].vendor = ntb->vntb_vid; pci_vntb_table[0].device = ntb->vntb_pid; - if (pci_register_driver(&vntb_pci_driver)) { + ret = pci_register_driver(&vntb_pci_driver); + if (ret) { dev_err(dev, "failure register vntb pci driver\n"); goto err_bar_alloc; } |