[POWERPC] Fix idr locking in init_new_context
[powerpc.git] / arch / powerpc / mm / mmu_context_64.c
index 65d18dc..e2051ef 100644 (file)
@@ -44,7 +44,9 @@ again:
                return err;
 
        if (index > MAX_CONTEXT) {
+               spin_lock(&mmu_context_lock);
                idr_remove(&mmu_context_idr, index);
+               spin_unlock(&mmu_context_lock);
                return -ENOMEM;
        }