From: Serge E. Hallyn on 4 May 2010 11:20 Quoting David Howells (dhowells(a)redhat.com): > Serge E. Hallyn <serue(a)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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
First
|
Prev
|
Pages: 1 2 Prev: [PATCH v2 0/6] CFS Bandwidth Control Next: Where to submit bug report about linux-next? |