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: <1381299404.2040.19.camel@joe-AO722>
Date:	Tue, 08 Oct 2013 23:16:44 -0700
From:	Joe Perches <joe@...ches.com>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	Tejun Heo <tj@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
	Sangjung Woo <sangjung.woo@...sung.com>
Subject: Re: [RFC PATCH] device: Add kernel standard devm_k.alloc functions

On Tue, 2013-10-08 at 22:43 -0700, Greg KH wrote:
> On Tue, Oct 08, 2013 at 10:32:27PM -0700, Joe Perches wrote:
> > Currently, devm_ managed memory only supports kzalloc.
> > 
> > Convert the devm_kzalloc implementation to devm_kmalloc
> > and remove the complete memset to 0 but still set the
> > initial struct devres header and whatever padding before
> > data to 0.
> > 
> > Add the other normal alloc variants as static inlines with
> > __GFP_ZERO added to the gfp flag where appropriate:
> > 
> > 	devm_kzalloc
> > 	devm_kcalloc
> > 	devm_kmalloc_array
> > 
> > Add gfp.h to device.h for the newly added static inlines.
> > 
> > Signed-off-by: Joe Perches <joe@...ches.com>
> > ---
> >  drivers/base/devres.c  | 27 ++++++++++++++++-----------
> >  include/linux/device.h | 21 +++++++++++++++++++--
> >  2 files changed, 35 insertions(+), 13 deletions(-)
> 
> Makes sense to me, does this let other drivers start to use this where
> they were not able to in the past?

Yes.

There are some existing uses of devm_kzalloc(dev, n*size, gfp)
that could/should be converted.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ