mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
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: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
bc4fdca857
commit
8c696737aa
1 changed files with 3 additions and 1 deletions
|
@ -1199,8 +1199,10 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
|
|||
goto out;
|
||||
}
|
||||
err = ceph_init_dentry(dn);
|
||||
if (err < 0)
|
||||
if (err < 0) {
|
||||
dput(dn);
|
||||
goto out;
|
||||
}
|
||||
} else if (dn->d_inode &&
|
||||
(ceph_ino(dn->d_inode) != vino.ino ||
|
||||
ceph_snap(dn->d_inode) != vino.snap)) {
|
||||
|
|
Loading…
Reference in a new issue