diff mbox series

[net-next] nfp: fix error return code in nfp_pci_probe()

Message ID 1516673427-170584-1-git-send-email-weiyongjun1@huawei.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net-next] nfp: fix error return code in nfp_pci_probe() | expand

Commit Message

Wei Yongjun Jan. 23, 2018, 2:10 a.m. UTC
Fix to return error code -EINVAL instead of 0 when num_vfs above
limit_vfs, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/netronome/nfp/nfp_main.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jakub Kicinski Jan. 23, 2018, 2:33 a.m. UTC | #1
On Tue, 23 Jan 2018 02:10:27 +0000, Wei Yongjun wrote:
> Fix to return error code -EINVAL instead of 0 when num_vfs above
> limit_vfs, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Thanks!  FWIW here is the commit to blame:

Fixes: 0dc786219186 ("nfp: handle SR-IOV already enabled when driver is probing")
David Miller Jan. 23, 2018, 3:43 p.m. UTC | #2
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Tue, 23 Jan 2018 02:10:27 +0000

> Fix to return error code -EINVAL instead of 0 when num_vfs above
> limit_vfs, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c
index c5b9104..cc570bb 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c
@@ -518,6 +518,7 @@  static int nfp_pci_probe(struct pci_dev *pdev,
 		dev_err(&pdev->dev,
 			"Error: %d VFs already enabled, but loaded FW can only support %d\n",
 			pf->num_vfs, pf->limit_vfs);
+		err = -EINVAL;
 		goto err_fw_unload;
 	}