From: Christian Brauner Date: Thu, 12 Jun 2025 13:25:31 +0000 (+0200) Subject: coredump: auto cleanup argv X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a9f5d7fb6649af534c36aa8cc9c1aa51b172ad9;p=thirdparty%2Fkernel%2Fstable.git coredump: auto cleanup argv to prepare for a simpler exit path. Link: https://lore.kernel.org/20250612-work-coredump-massage-v1-17-315c0c34ba94@kernel.org Signed-off-by: Christian Brauner --- diff --git a/fs/coredump.c b/fs/coredump.c index dea4823b55b80..68da77d00170c 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -1076,7 +1076,7 @@ void vfs_coredump(const kernel_siginfo_t *siginfo) const struct cred *old_cred; struct cred *cred; int retval = 0; - size_t *argv = NULL; + size_t *argv __free(kfree) = NULL; int argc = 0; struct coredump_params cprm = { .siginfo = siginfo, @@ -1189,7 +1189,6 @@ close_fail: atomic_dec(&core_pipe_count); } fail_unlock: - kfree(argv); kfree(cn.corename); coredump_finish(cn.core_dumped); revert_creds(old_cred);