audit: remove unnecessary NULL ptr checks from do_path_lookup
As best I can tell, whenever retval == 0, nd->path.dentry and nd->inode are also non-NULL. Eliminate those checks and the superfluous audit_context check. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
79360ddd73
commit
f78570dd6a
|
@ -1972,12 +1972,8 @@ static int do_path_lookup(int dfd, const char *name,
|
||||||
if (unlikely(retval == -ESTALE))
|
if (unlikely(retval == -ESTALE))
|
||||||
retval = path_lookupat(dfd, name, flags | LOOKUP_REVAL, nd);
|
retval = path_lookupat(dfd, name, flags | LOOKUP_REVAL, nd);
|
||||||
|
|
||||||
if (likely(!retval)) {
|
if (likely(!retval))
|
||||||
if (unlikely(!audit_dummy_context())) {
|
audit_inode(name, nd->path.dentry);
|
||||||
if (nd->path.dentry && nd->inode)
|
|
||||||
audit_inode(name, nd->path.dentry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue