From: Ding Xiang Date: Tue, 4 Sep 2018 08:41:39 +0000 (+0800) Subject: security: tomoyo: Fix obsolete function X-Git-Tag: v4.20-rc1~118^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbdb75bd087954aaf9b3248109cb85748b62c21d;p=thirdparty%2Fkernel%2Flinux.git security: tomoyo: Fix obsolete function simple_strtoul is obsolete, and use kstrtouint instead Signed-off-by: Ding Xiang Acked-by: Tetsuo Handa Signed-off-by: James Morris --- diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index 03923a138ef54..9b38f94b5dd09 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c @@ -1660,7 +1660,8 @@ static void tomoyo_read_pid(struct tomoyo_io_buffer *head) head->r.eof = true; if (tomoyo_str_starts(&buf, "global-pid ")) global_pid = true; - pid = (unsigned int) simple_strtoul(buf, NULL, 10); + if (kstrtouint(buf, 10, &pid)) + return; rcu_read_lock(); if (global_pid) p = find_task_by_pid_ns(pid, &init_pid_ns);