Commit f86c9747 authored by Sonny Rao's avatar Sonny Rao Committed by Paul Mackerras

[POWERPC] Fix idr locking in init_new_context

We always need to serialize accesses to mmu_context_idr.

I hit this bug when testing with a small number of mmu contexts.
Signed-off-by: default avatarSonny Rao <sonny@burdell.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 975b3658
...@@ -44,7 +44,9 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) ...@@ -44,7 +44,9 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
return err; return err;
if (index > MAX_CONTEXT) { if (index > MAX_CONTEXT) {
spin_lock(&mmu_context_lock);
idr_remove(&mmu_context_idr, index); idr_remove(&mmu_context_idr, index);
spin_unlock(&mmu_context_lock);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment