lkml.org 
[lkml]   [2009]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2] net: use compat helper functions in compat_sys_recvmmsg
From: Heiko Carstens <heiko.carstens@de.ibm.com>

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>
---
net/compat.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

Index: linux-2.6/net/compat.c
===================================================================
--- linux-2.6.orig/net/compat.c
+++ linux-2.6/net/compat.c
@@ -763,15 +763,12 @@ asmlinkage long compat_sys_recvmmsg(int
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;

\
 
 \ /
  Last update: 2009-12-10 08:01    [W:0.034 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site