mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 08:42:10 +00:00
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:
parent
caf6bf48f9
commit
bd05aeb1ee
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user