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: <522ACB54.2050706@redhat.com>
Date:	Sat, 07 Sep 2013 08:44:36 +0200
From:	Daniel Borkmann <dborkman@...hat.com>
To:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
CC:	davem@...emloft.net, Jesse Brandeburg <jesse.brandeburg@...el.com>,
	netdev@...r.kernel.org, gospo@...hat.com, sassmann@...hat.com,
	Shannon Nelson <shannon.nelson@...el.com>,
	PJ Waskiewicz <peter.p.waskiewicz.jr@...el.com>,
	e1000-devel@...ts.sourceforge.net
Subject: Re: [net v6 1/8] i40e: main driver core

[...]
+i40e_status i40e_allocate_dma_mem_d(struct i40e_hw *hw,
+				    struct i40e_dma_mem *mem,
+				    u64 size, u32 alignment)
+{
+	struct i40e_pf *pf = (struct i40e_pf *)hw->back;
+
+	if (!mem)
+		return I40E_ERR_PARAM;
+
+	mem->size = ALIGN(size, alignment);
+	mem->va = dma_zalloc_coherent(&pf->pdev->dev, mem->size,
+				      &mem->pa, GFP_KERNEL);
+	if (mem->va)
+		return I40E_SUCCESS;
+
+	return I40E_ERR_NO_MEMORY;
+}

Nitpicking ... at some point in time i40e_status should be removed plus
I40E_ERR_PARAM, I40E_SUCCESS, I40E_ERR_NO_MEMORY and the like, as we have
int and -EINVAL, 0, -ENOMEM for that. ;-)

[...]
+i40e_status i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr,
+				 bool is_vf, bool is_netdev)
+{
+	struct i40e_mac_filter *f, *add_f;
+
+	list_for_each_entry(f, &vsi->mac_filter_list, list) {
[...]
+			if (!add_f) {
+				dev_info(&vsi->back->pdev->dev, "Could not add filter %d for %pM\n",
+					 f->vlan, f->macaddr);
+				return -ENOMEM;
+			}
+		}
+	}
+	return I40E_SUCCESS;
+}

Their usage seems also to be mixed anyway: -ENOMEM vs. I40E_SUCCESS.

[...]
+void i40e_vsi_reset_stats(struct i40e_vsi *vsi)
+{
+	struct rtnl_link_stats64 *ns;
+	int i;
+
+	if (!vsi)
+		return;
+
[...]
+static struct i40e_mac_filter *i40e_find_filter(struct i40e_vsi *vsi,
+						u8 *macaddr, s16 vlan,
+						bool is_vf, bool is_netdev)
+{
+	struct i40e_mac_filter *f;
+
+	if (!vsi || !macaddr)
+		return NULL;
[...]

Probably the code could also be scanned to remove such checks as well ...
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ