lkml.org 
[lkml]   [2008]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Distributed storage release.
Hi Evgeniy,

On Mon, Oct 13, 2008 at 4:38 PM, Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
>> > +static void *dst_crypto_thread_init(void *data)
>> > +{
>> > + struct dst_node *n = data;
>> > + struct dst_crypto_engine *e;
>> > + int err = -ENOMEM;
>> > +
>> > + e = kzalloc(sizeof(struct dst_crypto_engine), GFP_KERNEL);
>> > + if (!e)
>> > + goto err_out_exit;
>> > + e->src = kzalloc(sizeof(struct scatterlist) * 2 * n->max_pages,
>> > + GFP_KERNEL);
>>
>> kcalloc()?
>
> What's the difference? In saving one space and replacing another with
> comma? I do not particulary care, but would like to know why it is
> needed :)

kcalloc() will check for multiplication overflow which is nice
especially if size is passed from user-space (not sure if that applies
here).


\
 
 \ /
  Last update: 2008-10-13 15:47    [W:0.057 / U:2.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site