Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5079429pxj; Wed, 26 May 2021 02:16:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0IxcazH4Hf4XrXImHBSYypIHGHB2dLz95YHqGozTe+QGCfjVl9Ex/G2DudzKgn1YBQclF X-Received: by 2002:a05:6402:138c:: with SMTP id b12mr7849370edv.268.1622020574086; Wed, 26 May 2021 02:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622020574; cv=none; d=google.com; s=arc-20160816; b=ASdyYdCTT9ifjSVM8Oj7nd5to8yW6fxHuZahjFo1cUxD2rvBcIzbH2h+jwYRTchCyv DTUjyFtY7oETWtb1ZBew1eCxCHoOdqb5Dy7mK8NB/TMPN/xQy51zp6hfw7kZiIcdZ/dR NjE/1/X1oHAGJNlAnsx62uhjowLH+4Rjc6CJK8bukvqb8oxya94K1vbD2XPX9bvgpIHn 1RRWgCP/+LcxuB69uV3seHfJiorheSTpDTcSQbLmVFPpFmxsdgTiROAqBWhMGZ1yj2yG lD1S146Ko5pRr6QLQwE0TuZfWe4my/FG2lgafANk6+kCb/6/QkGOFUOtcieOTrRn7kzc XyYw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bqOeFy1swgVBLHQORp6GdrY8ujEx5fEOvbBY5jslBYk=; b=R18qVCzCCkIubUwxJVbv10S3nJ+0di8+siYmyOnYu6f0InTfTpWt2cErljl6Vs+Qyk yON2HjHIpXO3hMC6c0nbrjNpTm1IAxG83Rvvc9cNLUZg9xKGZZQAipTslUmC96w44eY6 4i0d7jr5HC+47QRYTlMvo3wbGcBqMgDQ3lQIAJuQeq4KuDLqR/RprAfPYdx5XL7CTkje qE0Yh4ZH3Tr/hqyUVaEMC3VLemcKQLPcBStbMV0hZrUi7dq7d9KIutZP9cn273CAakMo OQD/LtUF5qiPlxkYWr3KXDaGFHMrKFmQHGdF7buP/nKqmqEKz2pPm7OAgeyKpDVFRfoc 75Yw== 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 d4si17551169edv.465.2021.05.26.02.15.49; Wed, 26 May 2021 02:16:14 -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 S233663AbhEZJMG (ORCPT + 99 others); Wed, 26 May 2021 05:12:06 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5555 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233655AbhEZJL5 (ORCPT ); Wed, 26 May 2021 05:11:57 -0400 Received: from dggems702-chm.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FqlTK1TgvzkYSH; Wed, 26 May 2021 17:07:33 +0800 (CST) Received: from dggema756-chm.china.huawei.com (10.1.198.198) by dggems702-chm.china.huawei.com (10.3.19.179) 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:24 +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:23 +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 3/3] ocfs2: Replaced simple_strtoull() with kstrtoull() Date: Wed, 26 May 2021 09:20:20 +0000 Message-ID: <20210526092020.554341-3-chenhuang5@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210526092020.554341-1-chenhuang5@huawei.com> References: <20210526092020.554341-1-chenhuang5@huawei.com> 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 --- fs/ocfs2/cluster/heartbeat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 1169c8dc9106..f89ffcbd585f 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -1596,12 +1596,13 @@ static ssize_t o2hb_region_start_block_store(struct config_item *item, struct o2hb_region *reg = to_o2hb_region(item); unsigned long long tmp; char *p = (char *)page; + ssize_t ret; if (reg->hr_bdev) return -EINVAL; - tmp = simple_strtoull(p, &p, 0); - if (!p || (*p && (*p != '\n'))) + ret = kstrtoull(p, 0, &tmp); + if (ret) return -EINVAL; reg->hr_start_block = tmp; -- 2.25.1