mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] lib/test_string.c: return -ENOMEM on memset16_selftest allocation failure
@ 2022-02-07 10:36 Jiapeng Chong
  2022-02-07 12:15 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2022-02-07 10:36 UTC (permalink / raw)
  To: andy; +Cc: linux-kernel, Jiapeng Chong, Abaci Robot

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-07 13:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 10:36 [PATCH] lib/test_string.c: return -ENOMEM on memset16_selftest allocation failure Jiapeng Chong
2022-02-07 12:15 ` Andy Shevchenko

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®