diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/auditsc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 4d1bd62b090b..2e481141b014 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -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) |