aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/namei.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 856b2f5da51d..19f178ec5744 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1155,11 +1155,9 @@ static int fastcall do_path_lookup(int dfd, const char *name,
1155 current->total_link_count = 0; 1155 current->total_link_count = 0;
1156 retval = link_path_walk(name, nd); 1156 retval = link_path_walk(name, nd);
1157out: 1157out:
1158 if (likely(retval == 0)) { 1158 if (unlikely(!retval && !audit_dummy_context() && nd->dentry &&
1159 if (unlikely(!audit_dummy_context() && nd && nd->dentry &&
1160 nd->dentry->d_inode)) 1159 nd->dentry->d_inode))
1161 audit_inode(name, nd->dentry->d_inode); 1160 audit_inode(name, nd->dentry->d_inode);
1162 }
1163out_fail: 1161out_fail:
1164 return retval; 1162 return retval;
1165 1163