mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-04-01 03:44:08 +00:00
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: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
38cdce53da
commit
a4ff8dba7d
3 changed files with 8 additions and 4 deletions
|
@ -417,7 +417,7 @@ extern int audit_classify_arch(int arch);
|
||||||
/* Public API */
|
/* Public API */
|
||||||
extern void audit_finish_fork(struct task_struct *child);
|
extern void audit_finish_fork(struct task_struct *child);
|
||||||
extern int audit_alloc(struct task_struct *task);
|
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,
|
extern void __audit_syscall_entry(int arch,
|
||||||
int major, unsigned long a0, unsigned long a1,
|
int major, unsigned long a0, unsigned long a1,
|
||||||
unsigned long a2, unsigned long a3);
|
unsigned long a2, unsigned long a3);
|
||||||
|
@ -435,6 +435,11 @@ static inline int audit_dummy_context(void)
|
||||||
void *p = current->audit_context;
|
void *p = current->audit_context;
|
||||||
return !p || *(int *)p;
|
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,
|
static inline void audit_syscall_entry(int arch, int major, unsigned long a0,
|
||||||
unsigned long a1, unsigned long a2,
|
unsigned long a1, unsigned long a2,
|
||||||
unsigned long a3)
|
unsigned long a3)
|
||||||
|
|
|
@ -1594,7 +1594,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
|
||||||
*
|
*
|
||||||
* Called from copy_process and do_exit
|
* 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;
|
struct audit_context *context;
|
||||||
|
|
||||||
|
|
|
@ -964,8 +964,7 @@ NORET_TYPE void do_exit(long code)
|
||||||
acct_collect(code, group_dead);
|
acct_collect(code, group_dead);
|
||||||
if (group_dead)
|
if (group_dead)
|
||||||
tty_audit_exit();
|
tty_audit_exit();
|
||||||
if (unlikely(tsk->audit_context))
|
audit_free(tsk);
|
||||||
audit_free(tsk);
|
|
||||||
|
|
||||||
tsk->exit_code = code;
|
tsk->exit_code = code;
|
||||||
taskstats_exit(tsk, group_dead);
|
taskstats_exit(tsk, group_dead);
|
||||||
|
|
Loading…
Add table
Reference in a new issue