Skip to content

Commit

Permalink
NTB: EPF: Fix error code in epf_ntb_bind()
Browse files Browse the repository at this point in the history
Return an error code if pci_register_driver() fails.  Don't return
success.

Fixes: da51fd2 ("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>
  • Loading branch information
Dan Carpenter authored and Jon Mason committed Aug 9, 2022
1 parent ae9f38a commit 3305f43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/pci/endpoint/functions/pci-epf-vntb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3305f43

Please sign in to comment.