diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-02-02 06:27:56 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-02-19 13:31:40 +0300 |
commit | 5cba372c0fe78d24e83d9e0556ecbeb219625c15 (patch) | |
tree | dcb8742257a0243d9afbe157cb6f6222afd98371 /fs/ceph/inode.c | |
parent | 3de22be6771353241eaec237fe594dfea3daf30f (diff) | |
download | linux-5cba372c0fe78d24e83d9e0556ecbeb219625c15.tar.xz |
ceph: fix dentry leaks
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index f88a0f059dc8..be3af18e4cf1 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1449,12 +1449,14 @@ retry_lookup: } if (!dn->d_inode) { - dn = splice_dentry(dn, in, NULL); - if (IS_ERR(dn)) { - err = PTR_ERR(dn); + struct dentry *realdn = splice_dentry(dn, in, NULL); + if (IS_ERR(realdn)) { + err = PTR_ERR(realdn); + d_drop(dn); dn = NULL; goto next_item; } + dn = realdn; } di = dn->d_fsdata; |