From: Heiko Carstens Date: Wed, 9 Dec 2009 20:59:15 +0000 (+0000) Subject: net: use compat helper functions in compat_sys_recvmmsg X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de039f02d877af52b8d0fe77878b8343a0f99d8b;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Heiko Carstens Acked-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- 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, return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, flags | MSG_CMSG_COMPAT, NULL); - if (get_user(ktspec.tv_sec, &timeout->tv_sec) || - get_user(ktspec.tv_nsec, &timeout->tv_nsec)) + if (get_compat_timespec(&ktspec, timeout)) return -EFAULT; datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, flags | MSG_CMSG_COMPAT, &ktspec); - if (datagrams > 0 && - (put_user(ktspec.tv_sec, &timeout->tv_sec) || - put_user(ktspec.tv_nsec, &timeout->tv_nsec))) + if (datagrams > 0 && put_compat_timespec(&ktspec, timeout)) datagrams = -EFAULT; return datagrams;