Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5675
b: refs/heads/master
c: 00a5dfd
h: refs/heads/master
i:
  5673: ca6b51d
  5671: 44634c5
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Aug 5, 2005
1 parent 876471a commit 746a321
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba02508248e90a9d696aebd18b48a3290235b53c
refs/heads/master: 00a5dfdb93f74e4d95fb0d83c890728e331f8810
10 changes: 3 additions & 7 deletions trunk/ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ static inline void lock_semundo(void)
struct sem_undo_list *undo_list;

undo_list = current->sysvsem.undo_list;
if ((undo_list != NULL) && (atomic_read(&undo_list->refcnt) != 1))
if (undo_list)
spin_lock(&undo_list->lock);
}

Expand All @@ -915,7 +915,7 @@ static inline void unlock_semundo(void)
struct sem_undo_list *undo_list;

undo_list = current->sysvsem.undo_list;
if ((undo_list != NULL) && (atomic_read(&undo_list->refcnt) != 1))
if (undo_list)
spin_unlock(&undo_list->lock);
}

Expand Down Expand Up @@ -943,9 +943,7 @@ static inline int get_undo_list(struct sem_undo_list **undo_listp)
if (undo_list == NULL)
return -ENOMEM;
memset(undo_list, 0, size);
/* don't initialize unodhd->lock here. It's done
* in copy_semundo() instead.
*/
spin_lock_init(&undo_list->lock);
atomic_set(&undo_list->refcnt, 1);
current->sysvsem.undo_list = undo_list;
}
Expand Down Expand Up @@ -1231,8 +1229,6 @@ int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
error = get_undo_list(&undo_list);
if (error)
return error;
if (atomic_read(&undo_list->refcnt) == 1)
spin_lock_init(&undo_list->lock);
atomic_inc(&undo_list->refcnt);
tsk->sysvsem.undo_list = undo_list;
} else
Expand Down

0 comments on commit 746a321

Please sign in to comment.