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-next>] [day] [month] [year] [list]
Date:	Mon, 27 Jun 2016 10:00:54 +0300
From:	Leon Romanovsky <leon@...nel.org>
To:	"Wei Hu (Xavier)" <xavier.huwei@...wei.com>
Cc:	Lijun Ou <oulijun@...wei.com>, dledford@...hat.com,
	sean.hefty@...el.com, hal.rosenstock@...il.com,
	davem@...emloft.net, jeffrey.t.kirsher@...el.com,
	jiri@...lanox.com, ogerlitz@...lanox.com,
	linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org, gongyangming@...wei.com,
	xiaokun@...wei.com, tangchaofei@...wei.com, haifeng.wei@...wei.com,
	yisen.zhuang@...wei.com, yankejian@...wei.com,
	charles.chenxin@...wei.com, linuxarm@...wei.com
Subject: Re: [PATCH v10 03/22] IB/hns: Add initial main frame driver and get
 cfg info

On Sat, Jun 25, 2016 at 06:29:31PM +0800, Wei Hu (Xavier) wrote:
> 
> 
> On 2016/6/24 19:48, Leon Romanovsky wrote:
> >On Thu, Jun 16, 2016 at 10:35:11PM +0800, Lijun Ou wrote:
> >>This patch mainly added the initial bare main driver. It
> >>could get the relative configure information of net node.
> >>
> >>Signed-off-by: Wei Hu <xavier.huwei@...wei.com>
> >>Signed-off-by: Nenglong Zhao <zhaonenglong@...ilicon.com>
> >>Signed-off-by: Lijun Ou <oulijun@...wei.com>
> >>---

...

> >>+		return -ENOMEM;
> >>+
> >>+	for (i = 0; i < HNS_ROCE_MAX_PORTS; i++) {
> >>+		net_node = of_parse_phandle(np, "eth-handle", i);
> >>+		if (net_node) {
> >>+			pdev = of_find_device_by_node(net_node);
> >>+			netdev = platform_get_drvdata(pdev);
> >>+			phy_port = (u8)i;
> >>+			if (netdev) {
> >>+				hr_dev->iboe.netdevs[port_cnt] = netdev;
> >>+				hr_dev->iboe.phy_port[port_cnt] = phy_port;
> >>+			} else {
> >>+				return -ENODEV;
> >>+			}
> >>+			port_cnt++;
> >>+		}
> >>+	}
> >Do you want to check port_cnt value, before continue?
> Hi, Leon
>     Maybe we need not to check port_cnt value.
>     port_cnt can be ensured smaller than HNS_ROCE_MAX_PORTS.

You can in theory to get port_cnt == 0, in such case it is wise to
return error.


Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ