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: <20111216.153254.1998330487051662169.davem@davemloft.net>
Date:	Fri, 16 Dec 2011 15:32:54 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	timur@...escale.com
Cc:	afleming@...escale.com, netdev@...r.kernel.org,
	linuxppc-dev@...abs.org
Subject: Re: [PATCH] phylib: update mdiobus_alloc() to allocate extra
 private space

From: Timur Tabi <timur@...escale.com>
Date: Thu, 15 Dec 2011 11:12:01 -0600

> Andy Fleming wrote:
>> Why? Doesn't this just obfuscate things a little, while providing no immediate benefit?
> 
> I see code like this frequently:
> 
> 	bus = mdiobus_alloc();
> 	if (bus == NULL)
> 		return -ENOMEM;
> 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> 	if (priv == NULL) {
> 		err = -ENOMEM;
> 		goto out_free;
> 	}
> 	bus->priv = priv;

Where "frequently", all of the mdiobus_alloc() call sites in your patch just
get translated to pass "0" for the private size.

Make the change how I suggested, where mdiobus_alloc() retains it's current
function signature and semantics.  Then you can edit drivers as needed rather
than from the beginning.
--
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