mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] coredump: Fix return value in coredump_parse()
@ 2025-08-19  9:41 Dan Carpenter
  2025-08-19 10:10 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-08-19  9:41 UTC (permalink / raw)
  To: Christian Brauner
  Cc: Alexander Viro, Jan Kara, linux-fsdevel, linux-kernel, kernel-janitors

The coredump_parse() function is bool type.  It should return true on
success and false on failure.  The cn_printf() returns zero on success
or negative error codes.  This mismatch means that when "return err;"
here, it is treated as success instead of failure.  Change it to return
false instead.

Fixes: a5715af549b2 ("coredump: make coredump_parse() return bool")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 fs/coredump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/coredump.c b/fs/coredump.c
index e5d9d6276990..f9d82ffc4b88 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -345,7 +345,7 @@ static bool coredump_parse(struct core_name *cn, struct coredump_params *cprm,
 				was_space = false;
 				err = cn_printf(cn, "%c", '\0');
 				if (err)
-					return err;
+					return false;
 				(*argv)[(*argc)++] = cn->used;
 			}
 		}
-- 
2.47.2


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

end of thread, other threads:[~2025-08-19 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-19  9:41 [PATCH] coredump: Fix return value in coredump_parse() Dan Carpenter
2025-08-19 10:10 ` Christian Brauner

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®