Skip to content

Commit 5153053

Browse files
committed
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>
1 parent 9f29a34 commit 5153053

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

fs/coredump.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,15 @@ static bool coredump_pipe(struct core_name *cn, struct coredump_params *cprm,
10241024
return false;
10251025
}
10261026

1027+
/*
1028+
* umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would
1029+
* have this set to NULL.
1030+
*/
1031+
if (!cprm->file) {
1032+
coredump_report_failure("Core dump to |%s disabled", cn->corename);
1033+
return false;
1034+
}
1035+
10271036
return true;
10281037
}
10291038

@@ -1117,14 +1126,6 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
11171126
goto close_fail;
11181127

11191128
if ((cn.mask & COREDUMP_KERNEL) && !dump_interrupted()) {
1120-
/*
1121-
* umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would
1122-
* have this set to NULL.
1123-
*/
1124-
if (!cprm.file) {
1125-
coredump_report_failure("Core dump to |%s disabled", cn.corename);
1126-
goto close_fail;
1127-
}
11281129
if (!dump_vma_snapshot(&cprm))
11291130
goto close_fail;
11301131

0 commit comments

Comments
 (0)