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

Cc: Dmitry Vyukov <dvyu...@google.com>
Signed-off-by: Akinobu Mita <akinobu.m...@gmail.com>
---
 fs/proc/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index f3fc74c..c85376b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1371,7 +1371,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)
-- 
2.7.4

Reply via email to