Commit 0bf676d1 authored by Jiri Slaby's avatar Jiri Slaby Committed by Paul Moore

audit: cleanup prune_tree_thread

We can use kthread_run instead of kthread_create+wake_up_process for
creating the thread.

We do not need to set the task state to TASK_RUNNING after schedule(),
the process is in that state already.

And we do not need to set the state to TASK_INTERRUPTIBLE when not
doing schedule() as we set the state to TASK_RUNNING immediately
Signed-off-by: default avatarJiri Slaby <>
Cc: Paul Moore <>
Cc: Eric Paris <>
Cc: <>
Signed-off-by: default avatarPaul Moore <>
parent b562e44f
......@@ -661,10 +661,10 @@ static int tag_mount(struct vfsmount *mnt, void *arg)
static int prune_tree_thread(void *unused)
for (;;) {
if (list_empty(&prune_list))
if (list_empty(&prune_list)) {
......@@ -693,16 +693,14 @@ static int audit_launch_prune(void)
if (prune_thread)
return 0;
prune_thread = kthread_create(prune_tree_thread, NULL,
prune_thread = kthread_run(prune_tree_thread, NULL,
if (IS_ERR(prune_thread)) {
pr_err("cannot start thread audit_prune_tree");
prune_thread = NULL;
return -ENOMEM;
} else {
return 0;
return 0;
/* called with audit_filter_mutex */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment