diff options
Diffstat (limited to 'ipc/sem.c')
-rw-r--r-- | ipc/sem.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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 | ||