aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/sysctl.c')
-rw-r--r--net/sunrpc/sysctl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index 6c86e2a7d942..a18b36b5422d 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -70,7 +70,13 @@ static int proc_do_xprt(struct ctl_table *table, int write,
return 0;
}
len = svc_print_xprts(tmpbuf, sizeof(tmpbuf));
- return memory_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len);
+ *lenp = memory_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len);
+
+ if (*lenp < 0) {
+ *lenp = 0;
+ return -EINVAL;
+ }
+ return 0;
}
static int