summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/debugfs.c')
-rw-r--r--net/sunrpc/debugfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/debugfs.c b/net/sunrpc/debugfs.c
index 7cc1b8a6ef6d..e7b4d93566df 100644
--- a/net/sunrpc/debugfs.c
+++ b/net/sunrpc/debugfs.c
@@ -304,7 +304,8 @@ fault_disconnect_write(struct file *filp, const char __user *user_buf,
{
char buffer[16];
- len = min(len, sizeof(buffer) - 1);
+ if (len >= sizeof(buffer))
+ len = sizeof(buffer) - 1;
if (copy_from_user(buffer, user_buf, len))
return -EFAULT;
buffer[len] = '\0';