mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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>
This commit is contained in:
parent
60c2ffd3d2
commit
de039f02d8
1 changed files with 2 additions and 5 deletions
|
@ -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,
|
return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
|
||||||
flags | MSG_CMSG_COMPAT, NULL);
|
flags | MSG_CMSG_COMPAT, NULL);
|
||||||
|
|
||||||
if (get_user(ktspec.tv_sec, &timeout->tv_sec) ||
|
if (get_compat_timespec(&ktspec, timeout))
|
||||||
get_user(ktspec.tv_nsec, &timeout->tv_nsec))
|
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
|
datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
|
||||||
flags | MSG_CMSG_COMPAT, &ktspec);
|
flags | MSG_CMSG_COMPAT, &ktspec);
|
||||||
if (datagrams > 0 &&
|
if (datagrams > 0 && put_compat_timespec(&ktspec, timeout))
|
||||||
(put_user(ktspec.tv_sec, &timeout->tv_sec) ||
|
|
||||||
put_user(ktspec.tv_nsec, &timeout->tv_nsec)))
|
|
||||||
datagrams = -EFAULT;
|
datagrams = -EFAULT;
|
||||||
|
|
||||||
return datagrams;
|
return datagrams;
|
||||||
|
|
Loading…
Reference in a new issue