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]
Date:   Fri, 28 May 2021 18:42:07 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Michael Chan <michael.chan@...adcom.com>
Cc:     davem@...emloft.net, netdev@...r.kernel.org, gospo@...adcom.com,
        richardcochran@...il.com, pavan.chebbi@...adcom.com,
        edwin.peer@...adcom.com
Subject: Re: [PATCH net-next 3/7] bnxt_en: Add PTP clock APIs, ioctls, and
 ethtool methods.

On Fri, 28 May 2021 20:53:17 -0400 Michael Chan wrote:
> +int bnxt_ptp_init(struct bnxt *bp)

This function never fails.

> +	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
> +
> +	if (!ptp)
> +		return 0;
> +
> +	atomic_set(&ptp->tx_avail, BNXT_MAX_TX_TS);
> +
> +	memset(&ptp->cc, 0, sizeof(ptp->cc));
> +	ptp->cc.read = bnxt_cc_read;
> +	ptp->cc.mask = CYCLECOUNTER_MASK(64);
> +	ptp->cc.shift = 0;
> +	ptp->cc.mult = 1;
> +
> +	timecounter_init(&ptp->tc, &ptp->cc, ktime_to_ns(ktime_get_real()));
> +
> +	ptp->ptp_info = bnxt_ptp_caps;
> +	ptp->ptp_clock = ptp_clock_register(&ptp->ptp_info, &bp->pdev->dev);
> +	if (IS_ERR(ptp->ptp_clock))
> +		ptp->ptp_clock = NULL;

Why not propagate the error? I thought only NULL should be silently
ignored? I could be confused about the rules, tho :)

> +	return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ