Commit e2690695 authored by Peter Huewe's avatar Peter Huewe Committed by Miklos Szeredi

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: default avatarPeter Huewe <peterhuewe@gmx.de>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
parent 66f75a5d
...@@ -75,19 +75,13 @@ static ssize_t fuse_conn_limit_write(struct file *file, const char __user *buf, ...@@ -75,19 +75,13 @@ static ssize_t fuse_conn_limit_write(struct file *file, const char __user *buf,
unsigned global_limit) unsigned global_limit)
{ {
unsigned long t; unsigned long t;
char tmp[32];
unsigned limit = (1 << 16) - 1; unsigned limit = (1 << 16) - 1;
int err; int err;
if (*ppos || count >= sizeof(tmp) - 1) if (*ppos)
return -EINVAL;
if (copy_from_user(tmp, buf, count))
return -EINVAL; return -EINVAL;
tmp[count] = '\0'; err = kstrtoul_from_user(buf, count, 0, &t);
err = strict_strtoul(tmp, 0, &t);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment