diff options
Diffstat (limited to 'kernel/pid.c')
-rw-r--r-- | kernel/pid.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/pid.c b/kernel/pid.c index 55fd5900bac8..2e17c9c92cbe 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -269,12 +269,11 @@ struct pid *alloc_pid(struct pid_namespace *ns) | |||
269 | for (type = 0; type < PIDTYPE_MAX; ++type) | 269 | for (type = 0; type < PIDTYPE_MAX; ++type) |
270 | INIT_HLIST_HEAD(&pid->tasks[type]); | 270 | INIT_HLIST_HEAD(&pid->tasks[type]); |
271 | 271 | ||
272 | upid = pid->numbers + ns->level; | ||
272 | spin_lock_irq(&pidmap_lock); | 273 | spin_lock_irq(&pidmap_lock); |
273 | for (i = ns->level; i >= 0; i--) { | 274 | for ( ; upid >= pid->numbers; --upid) |
274 | upid = &pid->numbers[i]; | ||
275 | hlist_add_head_rcu(&upid->pid_chain, | 275 | hlist_add_head_rcu(&upid->pid_chain, |
276 | &pid_hash[pid_hashfn(upid->nr, upid->ns)]); | 276 | &pid_hash[pid_hashfn(upid->nr, upid->ns)]); |
277 | } | ||
278 | spin_unlock_irq(&pidmap_lock); | 277 | spin_unlock_irq(&pidmap_lock); |
279 | 278 | ||
280 | out: | 279 | out: |