net: fix compat_sys_recvmmsg parameter type
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 9 Dec 2009 20:58:16 +0000 (20:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Dec 2009 23:07:56 +0000 (15:07 -0800)
compat_sys_recvmmsg has a compat_timespec parameter and not a
timespec parameter. This way we also get rid of an odd cast.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/compat.h
net/compat.c

index 3c7d4e3..28d5428 100644 (file)
@@ -46,7 +46,7 @@ extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsi
 extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
 extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *,
                                           unsigned, unsigned,
-                                          struct timespec __user *);
+                                          struct compat_timespec __user *);
 extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
 extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
 
index e1a56ad..c4d9131 100644 (file)
@@ -754,26 +754,24 @@ asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len,
 
 asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
                                    unsigned vlen, unsigned int flags,
-                                   struct timespec __user *timeout)
+                                   struct compat_timespec __user *timeout)
 {
        int datagrams;
        struct timespec ktspec;
-       struct compat_timespec __user *utspec;
 
        if (timeout == NULL)
                return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
                                      flags | MSG_CMSG_COMPAT, NULL);
 
-       utspec = (struct compat_timespec __user *)timeout;
-       if (get_user(ktspec.tv_sec, &utspec->tv_sec) ||
-           get_user(ktspec.tv_nsec, &utspec->tv_nsec))
+       if (get_user(ktspec.tv_sec, &timeout->tv_sec) ||
+           get_user(ktspec.tv_nsec, &timeout->tv_nsec))
                return -EFAULT;
 
        datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
                                   flags | MSG_CMSG_COMPAT, &ktspec);
        if (datagrams > 0 &&
-           (put_user(ktspec.tv_sec, &utspec->tv_sec) ||
-            put_user(ktspec.tv_nsec, &utspec->tv_nsec)))
+           (put_user(ktspec.tv_sec, &timeout->tv_sec) ||
+            put_user(ktspec.tv_nsec, &timeout->tv_nsec)))
                datagrams = -EFAULT;
 
        return datagrams;