summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroel kluin <roel.kluin@gmail.com>2008-11-26 02:19:51 -0500
committerTheodore Ts'o <tytso@mit.edu>2008-11-26 02:19:51 -0500
commit1d5e145e366262c9ee63601ef0b11553e7be0c5e (patch)
tree947c730e12f9c4b462f66b8f60b1162f60b52798
parent12f4827456ad4044a7b87bb61b59bacc2822c520 (diff)
ext4: Use simple_strtol() instead of simple_strtoul() in ext4_ui_proc_open
Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--fs/ext4/super.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 4aa2040ecb42..ba23b48c56a1 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3521,18 +3521,15 @@ static int ext4_ui_proc_open(struct inode *inode, struct file *file)
static ssize_t ext4_ui_proc_write(struct file *file, const char __user *buf,
size_t cnt, loff_t *ppos)
{
- unsigned int *p = PDE(file->f_path.dentry->d_inode)->data;
+ unsigned long *p = PDE(file->f_path.dentry->d_inode)->data;
char str[32];
- unsigned long value;
if (cnt >= sizeof(str))
return -EINVAL;
if (copy_from_user(str, buf, cnt))
return -EFAULT;
- value = simple_strtol(str, NULL, 0);
- if (value < 0)
- return -ERANGE;
- *p = value;
+
+ *p = simple_strtoul(str, NULL, 0);
return cnt;
}