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: <20200623150233.440583b8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Tue, 23 Jun 2020 15:02:33 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Luo bin <luobin9@...wei.com>
Cc:     <davem@...emloft.net>, <linux-kernel@...r.kernel.org>,
        <netdev@...r.kernel.org>, <luoxianjun@...wei.com>,
        <yin.yinshi@...wei.com>, <cloud.wangxiaoyun@...wei.com>
Subject: Re: [PATCH net-next v2 5/5] hinic: add support to get eeprom
 information

On Tue, 23 Jun 2020 22:24:09 +0800 Luo bin wrote:
> +int hinic_get_sfp_eeprom(struct hinic_hwdev *hwdev, u8 *data, u16 *len)
> +{
> +	struct hinic_cmd_get_std_sfp_info sfp_info = {0};
> +	u16 out_size = sizeof(sfp_info);
> +	u8 port_id;
> +	int err;
> +
> +	if (!hwdev || !data || !len)
> +		return -EINVAL;

> +int hinic_get_sfp_type(struct hinic_hwdev *hwdev, u8 *data0, u8 *data1)
> +{
> +	u8 sfp_data[STD_SFP_INFO_MAX_SIZE];
> +	u16 len;
> +	int err;
> +
> +	if (!hwdev || !data0 || !data1)
> +		return -EINVAL;

No need to check these, callers are correct. We don't do defensive
programming in the kernel.

> +	return  0;

double space

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ