Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c696737 authored by Sage Weil's avatar Sage Weil
Browse files

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: default avatarSage Weil <sage@newdream.net>
parent bc4fdca8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1199,8 +1199,10 @@ retry_lookup:
				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)) {