Skip to content

Commit

Permalink
Add missing unlocks to error paths of mountpoint_last.
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Dave Jones authored and Al Viro committed Sep 10, 2013
1 parent 443ed25 commit bcceeeb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2261,12 +2261,15 @@ mountpoint_last(struct nameidata *nd, struct path *path)
dentry = d_alloc(dir, &nd->last);
if (!dentry) {
error = -ENOMEM;
mutex_unlock(&dir->d_inode->i_mutex);
goto out;
}
dentry = lookup_real(dir->d_inode, dentry, nd->flags);
error = PTR_ERR(dentry);
if (IS_ERR(dentry))
if (IS_ERR(dentry)) {
mutex_unlock(&dir->d_inode->i_mutex);
goto out;
}
}
mutex_unlock(&dir->d_inode->i_mutex);

Expand Down

0 comments on commit bcceeeb

Please sign in to comment.