aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/aquantia
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2019-11-06 14:59:21 +0000
committerDavid S. Miller <davem@davemloft.net>2019-11-06 21:21:09 -0800
commit1dcff44a9d2b74b3de2c854bbf11a5f765e7ba77 (patch)
tree1fee694915d917775a621ac1284af34bcf587cff /drivers/net/ethernet/aquantia
parentptp: ptp_clockmatrix: Fix missing unlock on error in idtcm_probe() (diff)
downloadlinux-dev-1dcff44a9d2b74b3de2c854bbf11a5f765e7ba77.tar.xz
linux-dev-1dcff44a9d2b74b3de2c854bbf11a5f765e7ba77.zip
net: aquantia: fix return value check in aq_ptp_init()
Function ptp_clock_register() returns ERR_PTR() and never returns NULL. The NULL test should be removed. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/aquantia')
-rw-r--r--drivers/net/ethernet/aquantia/atlantic/aq_ptp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
index 8175513e48c9..1f9eab74453e 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
@@ -1207,7 +1207,7 @@ int aq_ptp_init(struct aq_nic_s *aq_nic, unsigned int idx_vec)
aq_ptp->ptp_info = aq_ptp_clock;
aq_ptp_gpio_init(&aq_ptp->ptp_info, &mbox.info);
clock = ptp_clock_register(&aq_ptp->ptp_info, &aq_nic->ndev->dev);
- if (!clock || IS_ERR(clock)) {
+ if (IS_ERR(clock)) {
netdev_err(aq_nic->ndev, "ptp_clock_register failed\n");
err = PTR_ERR(clock);
goto err_exit;