mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-08 19:55:16 -05:00
Staging: ccree: Use kcalloc instead of kzalloc
Use kcalloc instead of kzalloc to check for overflow before multiplication. Done using the following semantic patch by coccinelle. http://coccinelle.lip6.fr/rules/kzalloc.cocci Signed-off-by: Srishti Sharma <[email protected]> Acked-by: Julia Lawall <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
2b8b4a2762
commit
aabdabad35
1 changed files with 1 additions and 1 deletions
|
|
@ -376,7 +376,7 @@ static int sys_init_dir(struct sys_dir *sys_dir, struct ssi_drvdata *drvdata,
|
|||
return -ENOMEM;
|
||||
/* allocate memory for directory's attributes list */
|
||||
sys_dir->sys_dir_attr_list =
|
||||
kzalloc(sizeof(struct attribute *) * (num_of_attrs + 1),
|
||||
kcalloc(num_of_attrs + 1, sizeof(struct attribute *),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!(sys_dir->sys_dir_attr_list)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue