Skip to content

Commit

Permalink
ext4: Use simple_strtol() instead of simple_strtoul() in ext4_ui_proc…
Browse files Browse the repository at this point in the history
…_open

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Roel Kluin authored and Theodore Ts'o committed Nov 26, 2008
1 parent 171bbfb commit 23475e2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 23475e2

Please sign in to comment.