Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp394391pxb; Mon, 7 Feb 2022 14:05:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqWEKSP2SlXxlMnQECZ02Yc5x1Beb/2wsrQPfC3AjYR12tLhCD/nVYAo50MKtm4yXZkHkc X-Received: by 2002:a63:f30e:: with SMTP id l14mr1125283pgh.410.1644271517801; Mon, 07 Feb 2022 14:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644271517; cv=none; d=google.com; s=arc-20160816; b=SIhBlevqNqDcp6TW3fE44Snadqjad9wWXKJTKNR8Sun8HfddX6g1Rno3Y0df8O0xpU 6lnlvb4gzfDkNcA3RgVjOO6ZHVVqiiXdPFRJFjrwc4Xo+rSpl11b+Fn/LEY0MtUDUeR3 RMpEp8IFvbF604vwRazz8btxYsJsLUafsqJm11FWHC1v5zTicvts0ixJ47VH2p9lAqPf KRz9q9dgttshOCDHEXCG4b1p5hHXNyfVv/ssi6jsiteHF4ZVp4zLgyLGRx4Y8kqmeMIR iZfGAl3n0uhq4aQRsVb6D4bHjf8lil4bGiR3v92goZVGq6v/EGKpE6R2BYwCvzDsGWSP EM6g== 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=aKVJI/F+CH+eXTWzQIANjBnwBtOu2AjVaxSqXdWh4Bk=; b=fzk3YycCfTwhmtmAYeXe73CXZsrwBmxIrp8Z9RqtTr7ppoNxFlLZYCk8hAPujGtRdf o3+68bNLhM/wkPpbFTGJMcRnmN3omCtYGby/lpFxxExuRA8DKmriGZgkmylI1aw0/Sqn s8Xc4Lj1EIv729OtHK2y5Tk+l6xMxGJBDlYjzeeRCy4GbM+wVGDXc5wGuPirs6sy5rhP /DErdmGLCF1O6LKR5Ep/9U3Yg6hoBTJD2Qa5uAngM+ZTAuUjTQePR4Yk4xoqJCu6e8kR RZLS5JvcUy3I3S5+lcvfya9fCMyuqZADEyebzWEhw4J9FedmpvfLNA3kXbpUq8WapAyr 3qkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6si5185557plr.609.2022.02.07.14.05.03; Mon, 07 Feb 2022 14:05:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349688AbiBGKjK (ORCPT + 99 others); Mon, 7 Feb 2022 05:39:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244822AbiBGKgf (ORCPT ); Mon, 7 Feb 2022 05:36:35 -0500 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D505C043181 for ; Mon, 7 Feb 2022 02:36:34 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0V3qO07L_1644230187; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0V3qO07L_1644230187) by smtp.aliyun-inc.com(127.0.0.1); Mon, 07 Feb 2022 18:36:32 +0800 From: Jiapeng Chong To: andy@kernel.org Cc: linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] lib/test_string.c: return -ENOMEM on memset16_selftest allocation failure Date: Mon, 7 Feb 2022 18:36:26 +0800 Message-Id: <20220207103626.103256-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clean up the following smatch warning: lib/test_string.c:14 memset16_selftest() warn: returning -1 instead of -ENOMEM is sloppy. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- lib/test_string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_string.c b/lib/test_string.c index 9dfd6f52de92..f23d6cd2d9c7 100644 --- a/lib/test_string.c +++ b/lib/test_string.c @@ -11,7 +11,7 @@ static __init int memset16_selftest(void) p = kmalloc(256 * 2 * 2, GFP_KERNEL); if (!p) - return -1; + return -ENOMEM; for (i = 0; i < 256; i++) { for (j = 0; j < 256; j++) { -- 2.20.1.7.g153144c