From: Sage Weil Date: Thu, 22 Jul 2010 21:11:56 +0000 (-0700) Subject: ceph: fix leak of dentry in ceph_init_dentry() error path X-Git-Tag: v2.6.35~16^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8c696737aa61316a252c4514d09dd163f1464d33;p=karo-tx-linux.git 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 --- diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 8f9b9fe8ef9f..3582e79f46e0 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -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)) {