net: use compat helper functions in compat_sys_recvmmsg
Subsystems (2)
PATCH 2/2 net: use compat helper functions in compat_sys_recvmmsg
From: Heiko Carstens <[email protected]>
Use (get|put)_compat_timespec helper functions to simplify the code.
Cc Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by Heiko Carstens <[email protected]>
--- net/compat.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
net/compat.c +2 -5
@@ -763,15 +763,12 @@ asmlinkage long compat_sys_recvmmsg(intreturn __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;
Em Thu, Dec 10, 2009 at 07:59:15AM +0100, Heiko Carstens escreveu:
Quoted 6 lines
From: Heiko Carstens <[email protected]>
Use (get|put)_compat_timespec helper functions to simplify the code.
Cc Arnaldo Carvalho de Melo <[email protected]>Signed-off-by Heiko Carstens <[email protected]>
Nice cleanup, thanks!
From: Arnaldo Carvalho de Melo <[email protected]>
Date: Thu, 10 Dec 2009 10:46:40 -0200
Quoted 11 lines
Em Thu, Dec 10, 2009 at 07:59:15AM +0100, Heiko Carstens escreveu:
Quoted 6 lines
From: Heiko Carstens <[email protected]>
Use (get|put)_compat_timespec helper functions to simplify the code.
Cc Arnaldo Carvalho de Melo <[email protected]>Signed-off-by Heiko Carstens <[email protected]>Nice cleanup, thanks!
Applied.