summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-07-22 14:11:56 -0700
committerSage Weil <sage@newdream.net>2010-07-23 10:02:07 -0700
commit8c696737aa61316a252c4514d09dd163f1464d33 (patch)
tree8f130d45380ac3f8bd897bf78bc7650c1bbb41b5
parentbc4fdca85734d12cd2c7a25c52323ef6e6e5adef (diff)
downloadlinux-3.10-8c696737aa61316a252c4514d09dd163f1464d33.tar.gz
linux-3.10-8c696737aa61316a252c4514d09dd163f1464d33.tar.bz2
linux-3.10-8c696737aa61316a252c4514d09dd163f1464d33.zip
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>
-rw-r--r--fs/ceph/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 8f9b9fe8ef9..3582e79f46e 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)) {