mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[PATCH] kernel core: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
304e61e6fb
commit
4668edc334
6 changed files with 7 additions and 14 deletions
|
|
@ -1070,14 +1070,13 @@ static struct sem_undo *find_undo(struct ipc_namespace *ns, int semid)
|
|||
ipc_rcu_getref(sma);
|
||||
sem_unlock(sma);
|
||||
|
||||
new = (struct sem_undo *) kmalloc(sizeof(struct sem_undo) + sizeof(short)*nsems, GFP_KERNEL);
|
||||
new = kzalloc(sizeof(struct sem_undo) + sizeof(short)*nsems, GFP_KERNEL);
|
||||
if (!new) {
|
||||
ipc_lock_by_ptr(&sma->sem_perm);
|
||||
ipc_rcu_putref(sma);
|
||||
sem_unlock(sma);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
memset(new, 0, sizeof(struct sem_undo) + sizeof(short)*nsems);
|
||||
new->semadj = (short *) &new[1];
|
||||
new->semid = semid;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue