Use the variant which zeroes the memory when allocating,
instead of having an explicit memset.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
out_frame[i] = stage_desc->out_frame[i];
}
- stage = kvmalloc(sizeof(*stage), GFP_KERNEL);
+ stage = kvzalloc(sizeof(*stage), GFP_KERNEL);
if (!stage) {
err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
goto ERR;
}
- memset(stage, 0, sizeof(*stage));
if (firmware) {
stage->binary = NULL;
}
/* allocate the stream instance */
- curr_stream = kmalloc(sizeof(struct ia_css_stream), GFP_KERNEL);
+ curr_stream = kzalloc(sizeof(struct ia_css_stream), GFP_KERNEL);
if (!curr_stream)
{
err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
return err;
}
/* default all to 0 */
- memset(curr_stream, 0, sizeof(struct ia_css_stream));
curr_stream->info.metadata_info = md_info;
/* allocate pipes */