aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/netronome/nfp/nfp_main.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2020-11-12 22:58:52 +0800
committerJakub Kicinski <kuba@kernel.org>2020-11-12 10:11:12 -0800
commit95530a59db3d4b41cf554b3bd150935eb46a44fd (patch)
treec126b14dafe385d0834bb4da03e49ec9670272d0 /drivers/net/ethernet/netronome/nfp/nfp_main.c
parentMerge branch 'selftests-pmtu-sh-improve-the-test-result-processing' (diff)
downloadlinux-dev-95530a59db3d4b41cf554b3bd150935eb46a44fd.tar.xz
linux-dev-95530a59db3d4b41cf554b3bd150935eb46a44fd.zip
nfp: Fix passing zero to 'PTR_ERR'
nfp_cpp_from_nfp6000_pcie() returns ERR_PTR() and never returns NULL. The NULL test should be removed, also return correct err. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Link: https://lore.kernel.org/r/20201112145852.6580-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_main.c')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c
index 7ff2ccbd43b0..e672614d2906 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c
@@ -724,10 +724,8 @@ static int nfp_pci_probe(struct pci_dev *pdev,
}
pf->cpp = nfp_cpp_from_nfp6000_pcie(pdev);
- if (IS_ERR_OR_NULL(pf->cpp)) {
+ if (IS_ERR(pf->cpp)) {
err = PTR_ERR(pf->cpp);
- if (err >= 0)
- err = -ENOMEM;
goto err_disable_msix;
}