diff options
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 9c9b2b6b22dd..5699c512057b 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -1039,9 +1039,11 @@ asmlinkage long sys_futex(u32 __user *uaddr, int op, int val, | |||
1039 | unsigned long timeout = MAX_SCHEDULE_TIMEOUT; | 1039 | unsigned long timeout = MAX_SCHEDULE_TIMEOUT; |
1040 | int val2 = 0; | 1040 | int val2 = 0; |
1041 | 1041 | ||
1042 | if ((op == FUTEX_WAIT) && utime) { | 1042 | if (utime && (op == FUTEX_WAIT)) { |
1043 | if (copy_from_user(&t, utime, sizeof(t)) != 0) | 1043 | if (copy_from_user(&t, utime, sizeof(t)) != 0) |
1044 | return -EFAULT; | 1044 | return -EFAULT; |
1045 | if (!timespec_valid(&t)) | ||
1046 | return -EINVAL; | ||
1045 | timeout = timespec_to_jiffies(&t) + 1; | 1047 | timeout = timespec_to_jiffies(&t) + 1; |
1046 | } | 1048 | } |
1047 | /* | 1049 | /* |