]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
coredump: avoid pointless variable
authorChristian Brauner <brauner@kernel.org>
Thu, 12 Jun 2025 13:25:37 +0000 (15:25 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 7 Jul 2025 10:24:51 +0000 (12:24 +0200)
we don't use that value at all so don't bother with it in the first
place.

Link: https://lore.kernel.org/20250612-work-coredump-massage-v1-23-315c0c34ba94@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/coredump.c

index d3f09bf71f5ff14dfb0cdb8b7899d9fab3e040e9..178eddbcd6ad7ed566247ae07c9251d2e62385f6 100644 (file)
@@ -1088,7 +1088,6 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
        struct mm_struct *mm = current->mm;
        struct linux_binfmt * binfmt;
        const struct cred *old_cred;
-       int retval = 0;
        int argc = 0;
        struct coredump_params cprm = {
                .siginfo = siginfo,
@@ -1123,8 +1122,7 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
        if (coredump_force_suid_safe(&cprm))
                cred->fsuid = GLOBAL_ROOT_UID;
 
-       retval = coredump_wait(siginfo->si_signo, &core_state);
-       if (retval < 0)
+       if (coredump_wait(siginfo->si_signo, &core_state) < 0)
                return;
 
        old_cred = override_creds(cred);
@@ -1160,8 +1158,7 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
 
        /* get us an unshared descriptor table; almost always a no-op */
        /* The cell spufs coredump code reads the file descriptor tables */
-       retval = unshare_files();
-       if (retval)
+       if (unshare_files())
                goto close_fail;
 
        if ((cn.mask & COREDUMP_KERNEL) && !coredump_write(&cn, &cprm, binfmt))