From 1d5de9236ce4575b6b00d35eccd40cb4219cf6be Mon Sep 17 00:00:00 2001 From: Igor Russkikh Date: Fri, 6 Nov 2020 18:36:55 -0500 Subject: [PATCH 038/139] [netdrv] net: aquantia: fix return value check in aq_ptp_init() Message-id: <1604687916-15087-39-git-send-email-irusskik@redhat.com> Patchwork-id: 338465 Patchwork-instance: patchwork O-Subject: [RHEL8.4 BZ 1857861 038/139] net: aquantia: fix return value check in aq_ptp_init() Bugzilla: 1857861 RH-Acked-by: David Arcari RH-Acked-by: John Linville RH-Acked-by: Tony Camuso Bugzilla: http://bugzilla.redhat.com/1857861 commit 1dcff44a9d2b74b3de2c854bbf11a5f765e7ba77 Author: Wei Yongjun Date: Wed Nov 6 14:59:21 2019 +0000 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 Acked-by: Igor Russkikh Signed-off-by: David S. Miller Signed-off-by: Igor Russkikh Cc: David Arcari Cc: Igor Russkikh Signed-off-by: Jan Stancek --- drivers/net/ethernet/aquantia/atlantic/aq_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.13.6