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

Commit 9cec9d68 authored by Jeff Layton's avatar Jeff Layton Committed by Al Viro
Browse files

audit: no need to walk list in audit_inode if name is NULL



If name is NULL then the condition in the loop will never be true. Also,
with this change, we can eliminate the check for n->name == NULL since
the equivalence check will never be true if it is.

Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 1c2e51e8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2147,11 +2147,15 @@ void __audit_inode(const char *name, const struct dentry *dentry)
	if (!context->in_syscall)
		return;

	if (!name)
		goto out_alloc;

	list_for_each_entry_reverse(n, &context->names_list, list) {
		if (n->name && (n->name == name))
		if (n->name == name)
			goto out;
	}

out_alloc:
	/* unable to find the name from a previous getname() */
	n = audit_alloc_name(context);
	if (!n)