nfp: fix error return code in nfp_pci_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 23 Jan 2018 02:10:27 +0000 (02:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Apr 2018 09:02:10 +0000 (11:02 +0200)
[ Upstream commit e58decc9c51eb61697aba35ba8eda33f4b80552d ]

Fix to return error code -EINVAL instead of 0 when num_vfs above
limit_vfs, as done elsewhere in this function.

Fixes: 0dc786219186 ("nfp: handle SR-IOV already enabled when driver is probing")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/netronome/nfp/nfp_main.c

index f8fa63b66739dfcc081b623ff7de717bb5928445..a1a15e0c22452d99d453355db27e55c4b70bae34 100644 (file)
@@ -492,6 +492,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;
        }