From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: andy@kernel.org
Cc: linux-kernel@vger.kernel.org,
Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH] lib/test_string.c: return -ENOMEM on memset16_selftest allocation failure
Date: Mon, 7 Feb 2022 18:36:26 +0800 [thread overview]
Message-ID: <20220207103626.103256-1-jiapeng.chong@linux.alibaba.com> (raw)
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 <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
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
next reply other threads:[~2022-02-07 10:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-07 10:36 Jiapeng Chong [this message]
2022-02-07 12:15 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220207103626.103256-1-jiapeng.chong@linux.alibaba.com \
--to=jiapeng.chong@linux.alibaba.com \
--cc=abaci@linux.alibaba.com \
--cc=andy@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®