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] [day] [month] [year] [list]
Message-ID: <20160811210246.GC18013@infradead.org>
Date:	Thu, 11 Aug 2016 14:02:46 -0700
From:	Christoph Hellwig <hch@...radead.org>
To:	James Smart <james.smart@...adcom.com>
Cc:	Bart Van Assche <bart.vanassche@...disk.com>,
	linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
	linux-scsi@...r.kernel.org
Subject: Re: [PATCH] add u64 number parser

On Sat, Jul 23, 2016 at 08:52:18AM -0700, James Smart wrote:
> 
> On 7/22/2016 6:32 PM, Bart Van Assche wrote:
> > On 07/22/16 17:23, James Smart wrote:
> > > +    buf = kmalloc(len + 1, GFP_KERNEL);
> > > +    if (!buf)
> > > +        return -ENOMEM;
> > > +    memcpy(buf, s->from, len);
> > > +    buf[len] = '\0';
> > 
> > Hello James,
> > 
> > Have you considered to combine the above kmalloc() and memcpy() calls
> > into a single kasprintf(GFP_KERNEL, "%.*s", len, s->from) call?
> > 
> > Bart.
> > 
> 
> No, I followed the example of existing parse functions in the file.

The kasprintf would indeed be nicer, but I'm fine with keeping the
existing style for this patch.  Bonus points for sending a follow on
to convert all of them over.

Reviewed-by: Christoph Hellwig <hch@....de>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ