mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 01:49:36 +00:00
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.cocci Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
e6cc710806
commit
abe5139248
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue