psi: introduce state_mask to represent stalled psi states
[linux-2.6-microblaze.git] / kernel / pid.c
index b2f6c50..2088159 100644 (file)
@@ -233,8 +233,10 @@ out_unlock:
 
 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)