]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
coredump: move pipe specific file check into coredump_pipe()
authorChristian Brauner <brauner@kernel.org>
Thu, 12 Jun 2025 13:25:28 +0000 (15:25 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 7 Jul 2025 10:24:50 +0000 (12:24 +0200)
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>
fs/coredump.c

index f4f7f0a0ae40252a1efdac3f17703d71eebbbe0f..1e05d831cda850c9f7dec139a4b37175baea4532 100644 (file)
@@ -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;