X-Git-Url: https://git.codelabs.ch/?p=muen%2Flinux.git;a=blobdiff_plain;f=fs%2Fproc%2Fbase.c;h=c1fdaecb8d23c99009d2aec5ec635f86b99ebd5b;hp=5d93512beea11878efe6cd2984e84ba23a728c51;hb=9049f2f6e7bdfb5de0c63c2635bf3cdb70c4efb5;hpb=ecaad81ca0dfaa5f6ab7a5a9bc16a10816e2bd27 diff --git a/fs/proc/base.c b/fs/proc/base.c index 5d93512beea1..c1fdaecb8d23 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1360,7 +1360,8 @@ static ssize_t proc_fail_nth_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct task_struct *task; - int err, n; + int err; + unsigned int n; task = get_proc_task(file_inode(file)); if (!task) @@ -1368,12 +1369,10 @@ static ssize_t proc_fail_nth_write(struct file *file, const char __user *buf, put_task_struct(task); if (task != current) return -EPERM; - err = kstrtoint_from_user(buf, count, 0, &n); + err = kstrtouint_from_user(buf, count, 0, &n); if (err) return err; - if (n < 0 || n == INT_MAX) - return -EINVAL; - current->fail_nth = n + 1; + current->fail_nth = n; return count; }