lkml.org 
[lkml]   [2010]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] RFC: p9auth: add p9auth fs
Quoting David Howells (dhowells@redhat.com):
> Serge E. Hallyn <serue@us.ibm.com> wrote:
>
> > + result = kzalloc(MAX_DIGEST_SIZE, GFP_KERNEL);
> > ...
> > + ret = crypto_hash_digest(&desc, &sg, plain_text_size, result);
>
> Does result have to be pre-cleared?
>
> > + user_buf = kzalloc(count+1, GFP_KERNEL);
> > + if (!user_buf)
> > + goto out;
> > +
> > + if (copy_from_user(user_buf, buffer, count)) {
>
> user_buf doesn't need preclearing. It's just a waste of time. This occurs
> three times.

Hm, yeah, the first doesn't need it at all, and the latter two
should just kmalloc and set user_buf[count] = '\0'.

thanks,

-serge


\
 
 \ /
  Last update: 2010-05-04 17:17    [W:0.060 / U:51.240 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site