aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/domain.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/tomoyo/domain.c')
-rw-r--r--security/tomoyo/domain.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c
index e68b1052354b..fcf52accce2b 100644
--- a/security/tomoyo/domain.c
+++ b/security/tomoyo/domain.c
@@ -786,13 +786,11 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char *
786/** 786/**
787 * tomoyo_find_next_domain - Find a domain. 787 * tomoyo_find_next_domain - Find a domain.
788 * 788 *
789 * @bprm: Pointer to "struct linux_binprm". 789 * @bprm: Pointer to "struct linux_binprm".
790 * @next_domain: Pointer to pointer to "struct tomoyo_domain_info".
791 * 790 *
792 * Returns 0 on success, negative value otherwise. 791 * Returns 0 on success, negative value otherwise.
793 */ 792 */
794int tomoyo_find_next_domain(struct linux_binprm *bprm, 793int tomoyo_find_next_domain(struct linux_binprm *bprm)
795 struct tomoyo_domain_info **next_domain)
796{ 794{
797 /* 795 /*
798 * This function assumes that the size of buffer returned by 796 * This function assumes that the size of buffer returned by
@@ -914,9 +912,11 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm,
914 tomoyo_set_domain_flag(old_domain, false, 912 tomoyo_set_domain_flag(old_domain, false,
915 TOMOYO_DOMAIN_FLAGS_TRANSITION_FAILED); 913 TOMOYO_DOMAIN_FLAGS_TRANSITION_FAILED);
916 out: 914 out:
915 if (!domain)
916 domain = old_domain;
917 bprm->cred->security = domain;
917 tomoyo_free(real_program_name); 918 tomoyo_free(real_program_name);
918 tomoyo_free(symlink_program_name); 919 tomoyo_free(symlink_program_name);
919 *next_domain = domain ? domain : old_domain;
920 tomoyo_free(tmp); 920 tomoyo_free(tmp);
921 return retval; 921 return retval;
922} 922}