Skip to content

Commit

Permalink
fault-inject: automatically detect the number base for fail-nth write…
Browse files Browse the repository at this point in the history
… interface

Automatically detect the number base to use when writing to fail-nth
file instead of always parsing as a decimal number.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Akinobu Mita <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mita authored and torvalds committed Jul 14, 2017
1 parent 5f92a7b commit ecaad81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ 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, 10, &n);
err = kstrtoint_from_user(buf, count, 0, &n);
if (err)
return err;
if (n < 0 || n == INT_MAX)
Expand Down

0 comments on commit ecaad81

Please sign in to comment.