Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5077453pxj; Wed, 26 May 2021 02:13:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbYJTz6Kj0tfDuB5dH22LTgOICc2YTaoEZHGmrZWxVGuJqBMe/Wc+r4DpkYCmF9VpUQi1e X-Received: by 2002:aa7:da0e:: with SMTP id r14mr36038652eds.119.1622020384865; Wed, 26 May 2021 02:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622020384; cv=none; d=google.com; s=arc-20160816; b=c34ezjNeJEeL4fa0FiJ+urWVmO/HpJcMe/K9He/RLuCdPRTaxycpY5dj6swVPLJFtb HMRSwIz1H4eBvI0Q9ZEMIzh7TYNOElTb4oV4vYSQ55LgTZnOloDlON59vpSUXDxvRbQu h4daV3epBm8UDXeTzXnNMt8UuzOPUGmrKkNVxlcGaibFqCBGFbh8nruR2wcds9CiEcXV 0Rd83xlbZ1QwEHBDpaPXhkcf+8lmq2ZzD4aq1AsfF8cCMEC6/jRq0blCqJKqJKAJu+Nj oUfzgVTCwKbsJJkZa88lrzL2aueFlsBSvTRVidwUzTBASFaJ++36ZkGyJ9bhxGrEV+N8 +mew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=gqqSaZEKrDHCufeUbObQ2PPyPJtimdGsZEN4QQi7Vmw=; b=tTstqJwhZK7IlBerhUlhp5BfwbjyvPEt8OLyHgojzKESy/WAol9cfXKrCDnah8q9mg 6Pj0kXhZuz9GMeseFrIYnXeb1wdfcGKVZnBtKSI0O0m1HCOAN/MuKwuuq9aRNWFW5TCv +kEycxnOWzH+adLY8iOT0KFdsjFsiRYfectBkEd78TtqqGHiaj8d8o1f+bV3IFMcdv34 fbOj4BscG4J8KT8pZLOigXU7ZlEAWhoAA2HjbsIV9BE6a811qcwmJeFrMmHIlGQt06Uw GMLIWEyA9WWkKUDMrOMjIBYYW0yQg9kATuR7bFhGpvl822OK4fnDmGxEd/wCITVocsXD aTkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x4si16837117ede.21.2021.05.26.02.12.41; Wed, 26 May 2021 02:13:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233673AbhEZJMC (ORCPT + 99 others); Wed, 26 May 2021 05:12:02 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:3947 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233630AbhEZJLz (ORCPT ); Wed, 26 May 2021 05:11:55 -0400 Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FqlTG6lRjzCx9y; Wed, 26 May 2021 17:07:30 +0800 (CST) Received: from dggema756-chm.china.huawei.com (10.1.198.198) by dggems704-chm.china.huawei.com (10.3.19.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 26 May 2021 17:10:18 +0800 Received: from localhost.localdomain (10.175.112.125) by dggema756-chm.china.huawei.com (10.1.198.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 26 May 2021 17:10:17 +0800 From: Chen Huang To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , "Boris Ostrovsky" , Juergen Gross , Stefano Stabellini , Mark Fasheh , Joel Becker , Joseph Qi , Nathan Lynch , Andrew Donnellan , Alexey Kardashevskiy , Andrew Morton , Stephen Rothwell , "Jens Axboe" , Yang Yingliang , "Masahiro Yamada" , Dan Carpenter CC: , , , , Chen Huang Subject: [PATCH -next 1/3] powerpc/rtas: Replaced simple_strtoull() with kstrtoull() Date: Wed, 26 May 2021 09:20:18 +0000 Message-ID: <20210526092020.554341-1-chenhuang5@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggema756-chm.china.huawei.com (10.1.198.198) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The simple_strtoull() function is deprecated in some situation, since it does not check for the range overflow, use kstrtoull() instead. Signed-off-by: Chen Huang --- arch/powerpc/kernel/rtas-proc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index 6857a5b0a1c3..117886782ebd 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c @@ -259,7 +259,6 @@ __initcall(proc_rtas_init); static int parse_number(const char __user *p, size_t count, u64 *val) { char buf[40]; - char *end; if (count > 39) return -EINVAL; @@ -269,11 +268,7 @@ static int parse_number(const char __user *p, size_t count, u64 *val) buf[count] = 0; - *val = simple_strtoull(buf, &end, 10); - if (*end && *end != '\n') - return -EINVAL; - - return 0; + return kstrtoull(buf, 10, val); } /* ****************************************************************** */ -- 2.25.1