Commit ecaad81c authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds

fault-inject: automatically detect the number base for fail-nth write 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/1491490561-10485-2-git-send-email-akinobu.mita@gmail.comSigned-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5f92a7b0
......@@ -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)
......
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