lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bfca5f2b-9d37-b45f-3478-fb64d676d23a@marvell.com>
Date:   Thu, 7 Nov 2019 00:00:50 +0000
From:   Igor Russkikh <irusskikh@...vell.com>
To:     Wei Yongjun <weiyongjun1@...wei.com>,
        Egor Pomozov <epomozov@...vell.com>,
        Igor Russkikh <Igor.Russkikh@...antia.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [EXT] [PATCH net-next] 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.

Thanks, Wei!

Function by itself could return null, but you are right, since this
code is now active only when PTP_1588_CLOCK is on - this is a useless check then.

> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
> ---
>  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 3ec08415e53e..252a80b6d3b6 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
> @@ -1205,7 +1205,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;

Acked-by: Igor Russkikh <irusskikh@...vell.com>

-- 
Regards,
  Igor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ