kernel: Fix potential refcount leak in su check

Change-Id: I7e1ecb78bfc951bf645a1462988dcd93c4247a9b
This commit is contained in:
Tom Marshall
2017-05-19 18:24:04 +00:00
committed by Stricted
parent 672c40a112
commit 05e290dfc9
+3 -1
View File
@@ -2012,8 +2012,10 @@ static int path_lookupat(int dfd, const char *name,
if (!err) {
struct super_block *sb = nd->inode->i_sb;
if (sb->s_flags & MS_RDONLY) {
if (d_is_su(nd->path.dentry) && !su_visible())
if (d_is_su(nd->path.dentry) && !su_visible()) {
path_put(&nd->path);
err = -ENOENT;
}
}
}