aboutsummaryrefslogtreecommitdiffstats
path: root/net/compat.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-12-09 15:59:15 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-11 18:07:57 -0500
commitde039f02d877af52b8d0fe77878b8343a0f99d8b (patch)
tree81d312952e828bddb53ff5d540f37b0ce8b202f6 /net/compat.c
parent60c2ffd3d2cf12008747d920ae118df119006003 (diff)
net: use compat helper functions in compat_sys_recvmmsg
Use (get|put)_compat_timespec helper functions to simplify the code. 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>
Diffstat (limited to 'net/compat.c')
-rw-r--r--net/compat.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/compat.c b/net/compat.c
index c4d9131a5872..a1fb1b079a82 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -763,15 +763,12 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
763 return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, 763 return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
764 flags | MSG_CMSG_COMPAT, NULL); 764 flags | MSG_CMSG_COMPAT, NULL);
765 765
766 if (get_user(ktspec.tv_sec, &timeout->tv_sec) || 766 if (get_compat_timespec(&ktspec, timeout))
767 get_user(ktspec.tv_nsec, &timeout->tv_nsec))
768 return -EFAULT; 767 return -EFAULT;
769 768
770 datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, 769 datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
771 flags | MSG_CMSG_COMPAT, &ktspec); 770 flags | MSG_CMSG_COMPAT, &ktspec);
772 if (datagrams > 0 && 771 if (datagrams > 0 && put_compat_timespec(&ktspec, timeout))
773 (put_user(ktspec.tv_sec, &timeout->tv_sec) ||
774 put_user(ktspec.tv_nsec, &timeout->tv_nsec)))
775 datagrams = -EFAULT; 772 datagrams = -EFAULT;
776 773
777 return datagrams; 774 return datagrams;