From: Akinobu Mita Date: Fri, 14 Jul 2017 21:49:49 +0000 (-0700) Subject: fault-inject: automatically detect the number base for fail-nth write interface X-Git-Tag: v4.13-rc1~18^2~8 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-linux.git;a=commitdiff_plain;h=ecaad81ca0dfaa5f6ab7a5a9bc16a10816e2bd27 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.com Signed-off-by: Akinobu Mita Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/proc/base.c b/fs/proc/base.c index 88b773f318cd..5d93512beea1 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -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)