X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=ipc%2Fsem.c;h=d3e12efd55cb39e6cdce7cd48ac73833100f60cf;hb=0e7bc4b9610ed9fde0fa14f0b7a7f939805e5ae9;hp=21b3289d640c1eb0989457f42f1eb4b62b675aff;hpb=0f66c08e9611b9a63f2f2fd5af0d12e486c4a02e;p=cascardo%2Flinux.git diff --git a/ipc/sem.c b/ipc/sem.c index 21b3289d640c..d3e12efd55cb 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -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;