]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/futex_compat.c
sdio: add /proc interface to sdio_uart driver
[linux-2.6-omap-h63xx.git] / kernel / futex_compat.c
index 338a9b489fbc34fc2ca2ceeecd19f44f2889dd21..7e52eb051f227f557a171e974312d35b9192944a 100644 (file)
@@ -61,10 +61,10 @@ void compat_exit_robust_list(struct task_struct *curr)
        if (fetch_robust_entry(&upending, &pending,
                               &head->list_op_pending, &pip))
                return;
-       if (upending)
+       if (pending)
                handle_futex_death((void __user *)pending + futex_offset, curr, pip);
 
-       while (compat_ptr(uentry) != &head->list) {
+       while (entry != (struct robust_list __user *) &head->list) {
                /*
                 * A pending lock might already be on the list, so
                 * dont process it twice:
@@ -144,20 +144,20 @@ asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
        struct timespec ts;
        ktime_t t, *tp = NULL;
        int val2 = 0;
+       int cmd = op & FUTEX_CMD_MASK;
 
-       if (utime && (op == FUTEX_WAIT || op == FUTEX_LOCK_PI)) {
+       if (utime && (cmd == FUTEX_WAIT || cmd == FUTEX_LOCK_PI)) {
                if (get_compat_timespec(&ts, utime))
                        return -EFAULT;
                if (!timespec_valid(&ts))
                        return -EINVAL;
 
                t = timespec_to_ktime(ts);
-               if (op == FUTEX_WAIT)
+               if (cmd == FUTEX_WAIT)
                        t = ktime_add(ktime_get(), t);
                tp = &t;
        }
-       if (op == FUTEX_REQUEUE || op == FUTEX_CMP_REQUEUE
-           || op == FUTEX_CMP_REQUEUE_PI)
+       if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE)
                val2 = (int) (unsigned long) utime;
 
        return do_futex(uaddr, op, val, tp, uaddr2, val2, val3);