提交 8c696737 编写于 作者: S Sage Weil

ceph: fix leak of dentry in ceph_init_dentry() error path

If we fail to allocate a ceph_dentry_info, don't leak the dn reference.
Signed-off-by: NSage Weil <sage@newdream.net>
上级 bc4fdca8
...@@ -1199,8 +1199,10 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req, ...@@ -1199,8 +1199,10 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
goto out; goto out;
} }
err = ceph_init_dentry(dn); err = ceph_init_dentry(dn);
if (err < 0) if (err < 0) {
dput(dn);
goto out; goto out;
}
} else if (dn->d_inode && } else if (dn->d_inode &&
(ceph_ino(dn->d_inode) != vino.ino || (ceph_ino(dn->d_inode) != vino.ino ||
ceph_snap(dn->d_inode) != vino.snap)) { ceph_snap(dn->d_inode) != vino.snap)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册