aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/futex.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-04-23 11:39:48 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-04-23 11:39:48 -0700
commit0e11d256512c5166e03c9e9f221f9371bd42911e (patch)
tree796921876230866c03dcb3463e633c62e0c99c51 /include/asm-generic/futex.h
parentMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff)
parentasm-generic/futex: Re-enable preemption in futex_atomic_cmpxchg_inatomic() (diff)
downloadlinux-dev-0e11d256512c5166e03c9e9f221f9371bd42911e.tar.xz
linux-dev-0e11d256512c5166e03c9e9f221f9371bd42911e.zip
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fixes from Ingo Molnar: "Misc fixes: pvqspinlocks: - an instrumentation fix futexes: - preempt-count vs pagefault_disable decouple corner case fix - futex requeue plist race window fix - futex UNLOCK_PI transaction fix for a corner case" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: asm-generic/futex: Re-enable preemption in futex_atomic_cmpxchg_inatomic() futex: Acknowledge a new waiter in counter before plist futex: Handle unlock_pi race gracefully locking/pvqspinlock: Fix division by zero in qstat_read()
Diffstat (limited to 'include/asm-generic/futex.h')
-rw-r--r--include/asm-generic/futex.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/asm-generic/futex.h b/include/asm-generic/futex.h
index e56272c919b5..bf2d34c9d804 100644
--- a/include/asm-generic/futex.h
+++ b/include/asm-generic/futex.h
@@ -108,11 +108,15 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
u32 val;
preempt_disable();
- if (unlikely(get_user(val, uaddr) != 0))
+ if (unlikely(get_user(val, uaddr) != 0)) {
+ preempt_enable();
return -EFAULT;
+ }
- if (val == oldval && unlikely(put_user(newval, uaddr) != 0))
+ if (val == oldval && unlikely(put_user(newval, uaddr) != 0)) {
+ preempt_enable();
return -EFAULT;
+ }
*uval = val;
preempt_enable();