[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201112145852.6580-1-yuehaibing@huawei.com>
Date: Thu, 12 Nov 2020 22:58:52 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <simon.horman@...ronome.com>, <kuba@...nel.org>,
<davem@...emloft.net>, <yuehaibing@...wei.com>
CC: <oss-drivers@...ronome.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] 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.
Fixes: 63461a028f76 ("nfp: add the PF driver")
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
drivers/net/ethernet/netronome/nfp/nfp_main.c | 4 +---
1 file changed, 1 insertion(+), 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;
}
--
2.17.1
Powered by blists - more mailing lists