futex: Correct the number of requeued waiters for PI
[sfrench/cifs-2.6.git] / kernel / futex.c
index 8ddc87cae25c5e33be8d803207dda413740b35c4..5439742856764edc8977772bb950760da350ecae 100644 (file)
@@ -2116,6 +2116,8 @@ retry_private:
 
                /* Ensure we requeue to the expected futex for requeue_pi. */
                if (requeue_pi && !match_futex(this->requeue_pi_key, &key2)) {
+                       /* Don't account for it */
+                       task_count--;
                        ret = -EINVAL;
                        break;
                }
@@ -2157,6 +2159,8 @@ retry_private:
                                 */
                                this->pi_state = NULL;
                                put_pi_state(pi_state);
+                               /* Don't account for it */
+                               task_count--;
                                /*
                                 * We stop queueing more waiters and let user
                                 * space deal with the mess.