kernel: Fix potential refcount leak in su check
Change-Id: I7e1ecb78bfc951bf645a1462988dcd93c4247a9b
This commit is contained in:
+3
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user