diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c index 787c7afdf8294eb2605c0aa0922a87567b3050a4..4f7262eba73d863be764f15e73680ea1e780eac4 100644 --- a/kernel/audit_watch.c +++ b/kernel/audit_watch.c @@ -366,12 +366,12 @@ static int audit_get_nd(struct audit_watch *watch, struct path *parent) struct dentry *d = kern_path_locked(watch->path, parent); if (IS_ERR(d)) return PTR_ERR(d); - inode_unlock(d_backing_inode(parent->dentry)); if (d_is_positive(d)) { /* update watch filter fields */ watch->dev = d->d_sb->s_dev; watch->ino = d_backing_inode(d)->i_ino; } + inode_unlock(d_backing_inode(parent->dentry)); dput(d); return 0; }