Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4ff8dba authored by Eric Paris's avatar Eric Paris Committed by Al Viro
Browse files

audit: inline audit_free to simplify the look of generic code



make the conditional a static inline instead of doing it in generic code.

Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent 38cdce53
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -417,7 +417,7 @@ extern int audit_classify_arch(int arch);
				/* Public API */
extern void audit_finish_fork(struct task_struct *child);
extern int  audit_alloc(struct task_struct *task);
extern void audit_free(struct task_struct *task);
extern void __audit_free(struct task_struct *task);
extern void __audit_syscall_entry(int arch,
				  int major, unsigned long a0, unsigned long a1,
				  unsigned long a2, unsigned long a3);
@@ -435,6 +435,11 @@ static inline int audit_dummy_context(void)
	void *p = current->audit_context;
	return !p || *(int *)p;
}
static inline void audit_free(struct task_struct *task)
{
	if (unlikely(task->audit_context))
		__audit_free(task);
}
static inline void audit_syscall_entry(int arch, int major, unsigned long a0,
				       unsigned long a1, unsigned long a2,
				       unsigned long a3)
+1 −1
Original line number Diff line number Diff line
@@ -1594,7 +1594,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
 *
 * Called from copy_process and do_exit
 */
void audit_free(struct task_struct *tsk)
void __audit_free(struct task_struct *tsk)
{
	struct audit_context *context;

+1 −2
Original line number Diff line number Diff line
@@ -964,7 +964,6 @@ NORET_TYPE void do_exit(long code)
	acct_collect(code, group_dead);
	if (group_dead)
		tty_audit_exit();
	if (unlikely(tsk->audit_context))
	audit_free(tsk);

	tsk->exit_code = code;