summaryrefslogtreecommitdiff
path: root/fs/coredump.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-06-12 15:25:28 +0200
committerChristian Brauner <brauner@kernel.org>2025-07-07 12:24:50 +0200
commit5153053692987035a82bb4a6714ea12a5bd2bfdc (patch)
treebdf64d4ad01d5501265805142def92a5c383b8de /fs/coredump.c
parent9f29a347d7b1b2022dfc6e5a93d4f2a7b34f5d4d (diff)
coredump: move pipe specific file check into coredump_pipe()
There's no point in having this eyesore in the middle of vfs_coredump(). Link: https://lore.kernel.org/20250612-work-coredump-massage-v1-14-315c0c34ba94@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/coredump.c')
-rw-r--r--fs/coredump.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/coredump.c b/fs/coredump.c
index f4f7f0a0ae40..1e05d831cda8 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -1024,6 +1024,15 @@ static bool coredump_pipe(struct core_name *cn, struct coredump_params *cprm,
return false;
}
+ /*
+ * umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would
+ * have this set to NULL.
+ */
+ if (!cprm->file) {
+ coredump_report_failure("Core dump to |%s disabled", cn->corename);
+ return false;
+ }
+
return true;
}
@@ -1117,14 +1126,6 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
goto close_fail;
if ((cn.mask & COREDUMP_KERNEL) && !dump_interrupted()) {
- /*
- * umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would
- * have this set to NULL.
- */
- if (!cprm.file) {
- coredump_report_failure("Core dump to |%s disabled", cn.corename);
- goto close_fail;
- }
if (!dump_vma_snapshot(&cprm))
goto close_fail;