Skip to content

Commit

Permalink
net: aquantia: fix return value check in aq_ptp_init()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Nov 7, 2019
1 parent b97fa0b commit 1dcff44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1dcff44

Please sign in to comment.