futex: Add missing error handling to FUTEX_REQUEUE_PI
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / pid.c
index 0db3e791a06d48594606bc4789bc8fbe0fd5a4f0..3cdba517360050c24bbb00ad97c13e63c9492a43 100644 (file)
@@ -264,6 +264,7 @@ void free_pid(struct pid *pid)
                struct pid_namespace *ns = upid->ns;
                hlist_del_rcu(&upid->pid_chain);
                switch(--ns->nr_hashed) {
+               case 2:
                case 1:
                        /* When all that is left in the pid namespace
                         * is the reaper wake up the reaper.  The reaper
@@ -334,6 +335,8 @@ out:
 
 out_unlock:
        spin_unlock_irq(&pidmap_lock);
+       put_pid_ns(ns);
+
 out_free:
        while (++i <= ns->level)
                free_pidmap(pid->numbers + i);