Merge branch 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / ipc / compat.c
index 98b9016cab6c84e4e86151458a5e9b8063ffc6f2..a4695ada3275742e0bd5258e55ab046751fb38b4 100644 (file)
@@ -753,14 +753,8 @@ COMPAT_SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsems,
                       unsigned, nsops,
                       const struct compat_timespec __user *, timeout)
 {
-       struct timespec __user *ts64 = NULL;
-       if (timeout) {
-               struct timespec ts;
-               ts64 = compat_alloc_user_space(sizeof(*ts64));
-               if (get_compat_timespec(&ts, timeout))
-                       return -EFAULT;
-               if (copy_to_user(ts64, &ts, sizeof(ts)))
-                       return -EFAULT;
-       }
+       struct timespec __user *ts64;
+       if (compat_convert_timespec(&ts64, timeout))
+               return -EFAULT;
        return sys_semtimedop(semid, tsems, nsops, ts64);
 }