[PATCH 20/24] coredump: auto cleanup prepare_creds()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



which will allow us to simplify the exit path in further patches.

Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
---
 fs/coredump.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/coredump.c b/fs/coredump.c
index ba771729f878..0ad0f29a350d 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -1074,7 +1074,7 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
 	struct mm_struct *mm = current->mm;
 	struct linux_binfmt * binfmt;
 	const struct cred *old_cred;
-	struct cred *cred;
+	struct cred *cred __free(put_cred) = NULL;
 	int retval = 0;
 	size_t *argv __free(kfree) = NULL;
 	int argc = 0;
@@ -1113,7 +1113,7 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
 
 	retval = coredump_wait(siginfo->si_signo, &core_state);
 	if (retval < 0)
-		goto fail_creds;
+		return;
 
 	old_cred = override_creds(cred);
 
@@ -1192,8 +1192,6 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
 	kfree(cn.corename);
 	coredump_finish(cn.core_dumped);
 	revert_creds(old_cred);
-fail_creds:
-	put_cred(cred);
 	return;
 }
 

-- 
2.47.2





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux