Skip to content

Commit 0897fcb

Browse files
dentiscalprumjrjohansen
authored andcommitted
apparmor: make aa_set_current_onexec return void
Change the return type to void since it always return 0, and no need to do the checking in aa_set_current_onexec. Signed-off-by: Quanfa Fu <quanfafu@gmail.com> Reviewed-by: "Tyler Hicks (Microsoft)" <code@tyhicks.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent 06c2afb commit 0897fcb

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

security/apparmor/domain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ int aa_change_profile(const char *fqname, int flags)
14461446
}
14471447

14481448
/* full transition will be built in exec path */
1449-
error = aa_set_current_onexec(target, stack);
1449+
aa_set_current_onexec(target, stack);
14501450
}
14511451

14521452
audit:

security/apparmor/include/task.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct aa_task_ctx {
3030
};
3131

3232
int aa_replace_current_label(struct aa_label *label);
33-
int aa_set_current_onexec(struct aa_label *label, bool stack);
33+
void aa_set_current_onexec(struct aa_label *label, bool stack);
3434
int aa_set_current_hat(struct aa_label *label, u64 token);
3535
int aa_restore_previous_label(u64 cookie);
3636
struct aa_label *aa_get_task_label(struct task_struct *task);

security/apparmor/task.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,15 @@ int aa_replace_current_label(struct aa_label *label)
9393
* aa_set_current_onexec - set the tasks change_profile to happen onexec
9494
* @label: system label to set at exec (MAYBE NULL to clear value)
9595
* @stack: whether stacking should be done
96-
* Returns: 0 or error on failure
9796
*/
98-
int aa_set_current_onexec(struct aa_label *label, bool stack)
97+
void aa_set_current_onexec(struct aa_label *label, bool stack)
9998
{
10099
struct aa_task_ctx *ctx = task_ctx(current);
101100

102101
aa_get_label(label);
103102
aa_put_label(ctx->onexec);
104103
ctx->onexec = label;
105104
ctx->token = stack;
106-
107-
return 0;
108105
}
109106

110107
/**

0 commit comments

Comments
 (0)