kernel: Replace kmalloc() usages with kzalloc() (#2939)
This ensures we won't use uninitialized pointers for task work.
This commit is contained in:
@@ -47,7 +47,7 @@ static void remove_uid_from_arr(uid_t uid)
|
||||
if (allow_list_pointer == 0)
|
||||
return;
|
||||
|
||||
temp_arr = kmalloc(sizeof(allow_list_arr), GFP_KERNEL);
|
||||
temp_arr = kzalloc(sizeof(allow_list_arr), GFP_KERNEL);
|
||||
if (temp_arr == NULL) {
|
||||
pr_err("%s: unable to allocate memory\n", __func__);
|
||||
return;
|
||||
@@ -200,7 +200,7 @@ bool ksu_set_app_profile(struct app_profile *profile, bool persist)
|
||||
}
|
||||
|
||||
// not found, alloc a new node!
|
||||
p = (struct perm_data *)kmalloc(sizeof(struct perm_data), GFP_KERNEL);
|
||||
p = (struct perm_data *)kzalloc(sizeof(struct perm_data), GFP_KERNEL);
|
||||
if (!p) {
|
||||
pr_err("ksu_set_app_profile alloc failed\n");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user