Skip to content

Commit 12b2f11

Browse files
Chen Gangtorvalds
authored andcommitted
kernel/audit_tree.c: tree will leak memory when failure occurs in audit_trim_trees()
audit_trim_trees() calls get_tree(). If a failure occurs we must call put_tree(). [akpm@linux-foundation.org: run put_tree() before mutex_lock() for small scalability improvement] Signed-off-by: Chen Gang <gang.chen@asianux.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Eric Paris <eparis@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 373e0f3 commit 12b2f11

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/audit_tree.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,9 @@ void audit_trim_trees(void)
617617
}
618618
spin_unlock(&hash_lock);
619619
trim_marked(tree);
620-
put_tree(tree);
621620
drop_collected_mounts(root_mnt);
622621
skip_it:
622+
put_tree(tree);
623623
mutex_lock(&audit_filter_mutex);
624624
}
625625
list_del(&cursor);

0 commit comments

Comments
 (0)