aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2006-12-06 23:38:51 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:41 -0500
commit4668edc334ee90cf50c382c3e423cfc510b5a126 (patch)
treeee25ca93e72031f7f333b6c251a57a55ef089c90 /ipc
parent304e61e6fbadec586dfe002b535f169a04248e49 (diff)
[PATCH] kernel core: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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