coredump: avoid pointless cred reference count bump

The creds are allocated via prepare_creds() which has already taken a
reference.

Link: https://lore.kernel.org/r/20241125-work-cred-v2-12-68b9d38bb5b2@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Christian Brauner 2024-11-25 15:10:08 +01:00
parent caf6bf48f9
commit bd05aeb1ee
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -576,7 +576,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
if (retval < 0)
goto fail_creds;
old_cred = override_creds(get_new_cred(cred));
old_cred = override_creds(cred);
ispipe = format_corename(&cn, &cprm, &argv, &argc);
@ -781,7 +781,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
kfree(argv);
kfree(cn.corename);
coredump_finish(core_dumped);
put_cred(revert_creds(old_cred));
revert_creds(old_cred);
fail_creds:
put_cred(cred);
fail: