diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-09-06 15:31:03 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-09-06 15:31:03 +0200 |
| commit | 77dd3b3bd23111040c504be6bd873a5ad09f02df (patch) | |
| tree | 119ddcdf89d6a593a8fefea530249084559eeb44 /net/sunrpc/sysctl.c | |
| parent | 916c7a855174e3b53d182b97a26b2e27a29726a1 (diff) | |
| parent | 70bb08962ea9bd50797ae9f16b2493f5f7c65053 (diff) | |
Merge branch 'linus' into timers/ntp
Diffstat (limited to 'net/sunrpc/sysctl.c')
| -rw-r--r-- | net/sunrpc/sysctl.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 0f8c439b848..5231f7aaac0 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c @@ -60,24 +60,14 @@ static int proc_do_xprt(ctl_table *table, int write, struct file *file, void __user *buffer, size_t *lenp, loff_t *ppos) { char tmpbuf[256]; - int len; + size_t len; + if ((*ppos && !write) || !*lenp) { *lenp = 0; return 0; } - if (write) - return -EINVAL; - else { - len = svc_print_xprts(tmpbuf, sizeof(tmpbuf)); - if (!access_ok(VERIFY_WRITE, buffer, len)) - return -EFAULT; - - if (__copy_to_user(buffer, tmpbuf, len)) - return -EFAULT; - } - *lenp -= len; - *ppos += len; - return 0; + len = svc_print_xprts(tmpbuf, sizeof(tmpbuf)); + return simple_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len); } static int |
