summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2012-04-15 02:20:27 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2012-04-25 12:25:05 +0200
commite2690695ce5085677b84fbf2e38d2ed57cad39cd (patch)
tree3e9f852e1590d15057bd46ec7cd640db27b04257
parent66f75a5d028beaf67c931435fdc3e7823125730c (diff)
fuse: Convert to kstrtoul_from_user
This patch replaces the code for getting an number from a userspace buffer by a simple call to kstroul_from_user. This makes it easier to read and less error prone. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
-rw-r--r--fs/fuse/control.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index 42593c587d48..03ff5b1eba93 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -75,19 +75,13 @@ static ssize_t fuse_conn_limit_write(struct file *file, const char __user *buf,
unsigned global_limit)
{
unsigned long t;
- char tmp[32];
unsigned limit = (1 << 16) - 1;
int err;
- if (*ppos || count >= sizeof(tmp) - 1)
- return -EINVAL;
-
- if (copy_from_user(tmp, buf, count))
+ if (*ppos)
return -EINVAL;
- tmp[count] = '\0';
-
- err = strict_strtoul(tmp, 0, &t);
+ err = kstrtoul_from_user(buf, count, 0, &t);
if (err)
return err;