* [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* Re: [PATCH] coredump: Fix return value in coredump_parse()
2025-08-19 9:41 [PATCH] coredump: Fix return value in coredump_parse() Dan Carpenter
@ 2025-08-19 10:10 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2025-08-19 10:10 UTC (permalink / raw)
To: Dan Carpenter
Cc: Christian Brauner, Alexander Viro, Jan Kara, linux-fsdevel,
linux-kernel, kernel-janitors
On Tue, 19 Aug 2025 12:41:15 +0300, Dan Carpenter wrote:
> 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.
>
>
> [...]
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] coredump: Fix return value in coredump_parse()
https://git.kernel.org/vfs/vfs/c/55f6e0b265d6
^ 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®