Skip to content

Commit

Permalink
audit: remove unnecessary NULL ptr checks from do_path_lookup
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jeff Layton <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
jtlayton authored and Al Viro committed Oct 12, 2012
1 parent 79360dd commit f78570d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1972,12 +1972,8 @@ static int do_path_lookup(int dfd, const char *name,
if (unlikely(retval == -ESTALE))
retval = path_lookupat(dfd, name, flags | LOOKUP_REVAL, nd);

if (likely(!retval)) {
if (unlikely(!audit_dummy_context())) {
if (nd->path.dentry && nd->inode)
audit_inode(name, nd->path.dentry);
}
}
if (likely(!retval))
audit_inode(name, nd->path.dentry);
return retval;
}

Expand Down

0 comments on commit f78570d

Please sign in to comment.