aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/futex.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/futex.c')
-rw-r--r--kernel/futex.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index feb724b2554e..9c9b2b6b22dd 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -913,15 +913,15 @@ err_unlock:
913 * Process a futex-list entry, check whether it's owned by the 913 * Process a futex-list entry, check whether it's owned by the
914 * dying task, and do notification if so: 914 * dying task, and do notification if so:
915 */ 915 */
916int handle_futex_death(unsigned int *uaddr, struct task_struct *curr) 916int handle_futex_death(u32 __user *uaddr, struct task_struct *curr)
917{ 917{
918 unsigned int futex_val; 918 u32 uval;
919 919
920repeat: 920retry:
921 if (get_user(futex_val, uaddr)) 921 if (get_user(uval, uaddr))
922 return -1; 922 return -1;
923 923
924 if ((futex_val & FUTEX_TID_MASK) == curr->pid) { 924 if ((uval & FUTEX_TID_MASK) == curr->pid) {
925 /* 925 /*
926 * Ok, this dying thread is truly holding a futex 926 * Ok, this dying thread is truly holding a futex
927 * of interest. Set the OWNER_DIED bit atomically 927 * of interest. Set the OWNER_DIED bit atomically
@@ -932,12 +932,11 @@ repeat:
932 * thread-death.) The rest of the cleanup is done in 932 * thread-death.) The rest of the cleanup is done in
933 * userspace. 933 * userspace.
934 */ 934 */
935 if (futex_atomic_cmpxchg_inuser(uaddr, futex_val, 935 if (futex_atomic_cmpxchg_inatomic(uaddr, uval,
936 futex_val | FUTEX_OWNER_DIED) != 936 uval | FUTEX_OWNER_DIED) != uval)
937 futex_val) 937 goto retry;
938 goto repeat;
939 938
940 if (futex_val & FUTEX_WAITERS) 939 if (uval & FUTEX_WAITERS)
941 futex_wake((unsigned long)uaddr, 1); 940 futex_wake((unsigned long)uaddr, 1);
942 } 941 }
943 return 0; 942 return 0;
@@ -985,7 +984,6 @@ void exit_robust_list(struct task_struct *curr)
985 if (handle_futex_death((void *)entry + futex_offset, 984 if (handle_futex_death((void *)entry + futex_offset,
986 curr)) 985 curr))
987 return; 986 return;
988
989 /* 987 /*
990 * Fetch the next entry in the list: 988 * Fetch the next entry in the list:
991 */ 989 */