Commit abe51392 authored by Srishti Sharma's avatar Srishti Sharma Committed by Mauro Carvalho Chehab

media: Staging: media: atomisp: Use kcalloc instead of kzalloc

Use kcalloc instead of kzalloc to check for an overflow before
multiplication. Done using the following semantic patch by
coccinelle.

http://coccinelle.lip6.fr/rules/kzalloc.cocciSigned-off-by: default avatarSrishti Sharma <srishtishar@gmail.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent e6cc7108
......@@ -235,7 +235,9 @@ sh_css_load_firmware(const char *fw_data,
sh_css_blob_info = NULL;
}
fw_minibuffer = kzalloc(sh_css_num_binaries * sizeof(struct fw_param), GFP_KERNEL);
fw_minibuffer = kcalloc(sh_css_num_binaries, sizeof(struct fw_param),
GFP_KERNEL);
if (fw_minibuffer == NULL)
return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment