summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-10-10 21:25:20 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-12 06:31:59 +0200
commitf78570dd6ad9563fffd24cc5e1808e1a1242f16e (patch)
treef7f7101c35a019e860233cbb0db2d2ef40bc23e0 /fs/namei.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir... (diff)
downloadlinux-f78570dd6ad9563fffd24cc5e1808e1a1242f16e.tar.xz
linux-f78570dd6ad9563fffd24cc5e1808e1a1242f16e.zip
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>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/namei.c b/fs/namei.c
index c1f18e4f034c..f04ce1142297 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -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;
}