diff options
Diffstat (limited to 'kernel/futex.c')
| -rw-r--r-- | kernel/futex.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 1dc98e4dd287..cf0c8e21d1ab 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
| @@ -476,6 +476,12 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, struct futex_q *me) | |||
| 476 | * the refcount and return its pi_state: | 476 | * the refcount and return its pi_state: |
| 477 | */ | 477 | */ |
| 478 | pi_state = this->pi_state; | 478 | pi_state = this->pi_state; |
| 479 | /* | ||
| 480 | * Userspace might have messed up non PI and PI futexes | ||
| 481 | */ | ||
| 482 | if (unlikely(!pi_state)) | ||
| 483 | return -EINVAL; | ||
| 484 | |||
| 479 | atomic_inc(&pi_state->refcount); | 485 | atomic_inc(&pi_state->refcount); |
| 480 | me->pi_state = pi_state; | 486 | me->pi_state = pi_state; |
| 481 | 487 | ||
