]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/pid.c
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux.git] / kernel / pid.c
index b2f6c506035da7c75b6b7e277f8d7c1a7ee244a2..20881598bdfaccc2e0ad736e1e2f8228ca3299bf 100644 (file)
@@ -233,8 +233,10 @@ struct pid *alloc_pid(struct pid_namespace *ns)
 
 out_free:
        spin_lock_irq(&pidmap_lock);
-       while (++i <= ns->level)
-               idr_remove(&ns->idr, (pid->numbers + i)->nr);
+       while (++i <= ns->level) {
+               upid = pid->numbers + i;
+               idr_remove(&upid->ns->idr, upid->nr);
+       }
 
        /* On failure to allocate the first pid, reset the state */
        if (ns->pid_allocated == PIDNS_ADDING)