Commit 95530a59 authored by YueHaibing's avatar YueHaibing Committed by Jakub Kicinski

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: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
Link: https://lore.kernel.org/r/20201112145852.6580-1-yuehaibing@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 34b93f19
...@@ -724,10 +724,8 @@ static int nfp_pci_probe(struct pci_dev *pdev, ...@@ -724,10 +724,8 @@ static int nfp_pci_probe(struct pci_dev *pdev,
} }
pf->cpp = nfp_cpp_from_nfp6000_pcie(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); err = PTR_ERR(pf->cpp);
if (err >= 0)
err = -ENOMEM;
goto err_disable_msix; goto err_disable_msix;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment