aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'ipc')
-rw-r--r--ipc/sem.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ipc/sem.c b/ipc/sem.c
index 21b3289d640..d3e12efd55c 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)
1070 ipc_rcu_getref(sma); 1070 ipc_rcu_getref(sma);
1071 sem_unlock(sma); 1071 sem_unlock(sma);
1072 1072
1073 new = (struct sem_undo *) kmalloc(sizeof(struct sem_undo) + sizeof(short)*nsems, GFP_KERNEL); 1073 new = kzalloc(sizeof(struct sem_undo) + sizeof(short)*nsems, GFP_KERNEL);
1074 if (!new) { 1074 if (!new) {
1075 ipc_lock_by_ptr(&sma->sem_perm); 1075 ipc_lock_by_ptr(&sma->sem_perm);
1076 ipc_rcu_putref(sma); 1076 ipc_rcu_putref(sma);
1077 sem_unlock(sma); 1077 sem_unlock(sma);
1078 return ERR_PTR(-ENOMEM); 1078 return ERR_PTR(-ENOMEM);
1079 } 1079 }
1080 memset(new, 0, sizeof(struct sem_undo) + sizeof(short)*nsems);
1081 new->semadj = (short *) &new[1]; 1080 new->semadj = (short *) &new[1];
1082 new->semid = semid; 1081 new->semid = semid;
1083 1082