aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/sem.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/sem.c')
-rw-r--r--ipc/sem.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ipc/sem.c b/ipc/sem.c
index 69edeb1e2a65..0dafcc455f92 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1003,15 +1003,12 @@ static inline void unlock_semundo(void)
1003static inline int get_undo_list(struct sem_undo_list **undo_listp) 1003static inline int get_undo_list(struct sem_undo_list **undo_listp)
1004{ 1004{
1005 struct sem_undo_list *undo_list; 1005 struct sem_undo_list *undo_list;
1006 int size;
1007 1006
1008 undo_list = current->sysvsem.undo_list; 1007 undo_list = current->sysvsem.undo_list;
1009 if (!undo_list) { 1008 if (!undo_list) {
1010 size = sizeof(struct sem_undo_list); 1009 undo_list = kzalloc(sizeof(*undo_list), GFP_KERNEL);
1011 undo_list = (struct sem_undo_list *) kmalloc(size, GFP_KERNEL);
1012 if (undo_list == NULL) 1010 if (undo_list == NULL)
1013 return -ENOMEM; 1011 return -ENOMEM;
1014 memset(undo_list, 0, size);
1015 spin_lock_init(&undo_list->lock); 1012 spin_lock_init(&undo_list->lock);
1016 atomic_set(&undo_list->refcnt, 1); 1013 atomic_set(&undo_list->refcnt, 1);
1017 current->sysvsem.undo_list = undo_list; 1014 current->sysvsem.undo_list = undo_list;