diff options
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 5872e3507f35..5efa2f978032 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -270,7 +270,13 @@ static void wake_futex(struct futex_q *q) | |||
270 | /* | 270 | /* |
271 | * The waiting task can free the futex_q as soon as this is written, | 271 | * The waiting task can free the futex_q as soon as this is written, |
272 | * without taking any locks. This must come last. | 272 | * without taking any locks. This must come last. |
273 | * | ||
274 | * A memory barrier is required here to prevent the following store | ||
275 | * to lock_ptr from getting ahead of the wakeup. Clearing the lock | ||
276 | * at the end of wake_up_all() does not prevent this store from | ||
277 | * moving. | ||
273 | */ | 278 | */ |
279 | wmb(); | ||
274 | q->lock_ptr = NULL; | 280 | q->lock_ptr = NULL; |
275 | } | 281 | } |
276 | 282 | ||
@@ -350,6 +356,13 @@ retry: | |||
350 | if (bh1 != bh2) | 356 | if (bh1 != bh2) |
351 | spin_unlock(&bh2->lock); | 357 | spin_unlock(&bh2->lock); |
352 | 358 | ||
359 | #ifndef CONFIG_MMU | ||
360 | /* we don't get EFAULT from MMU faults if we don't have an MMU, | ||
361 | * but we might get them from range checking */ | ||
362 | ret = op_ret; | ||
363 | goto out; | ||
364 | #endif | ||
365 | |||
353 | if (unlikely(op_ret != -EFAULT)) { | 366 | if (unlikely(op_ret != -EFAULT)) { |
354 | ret = op_ret; | 367 | ret = op_ret; |
355 | goto out; | 368 | goto out; |