kernel: Fix potential refcount leak in su check
Change-Id: I8d2c8bed65a01eb0928308df638a04449a5bd881
This commit is contained in:
parent
e76227950e
commit
030f585c4e
1 changed files with 3 additions and 1 deletions
|
@ -2168,8 +2168,10 @@ static int path_lookupat(struct nameidata *nd, unsigned flags, struct path *path
|
||||||
if (!err) {
|
if (!err) {
|
||||||
struct super_block *sb = nd->inode->i_sb;
|
struct super_block *sb = nd->inode->i_sb;
|
||||||
if (sb->s_flags & MS_RDONLY) {
|
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;
|
err = -ENOENT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue