summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/inodelk.c
diff options
context:
space:
mode:
authorXavier Hernandez <jahernan@redhat.com>2017-11-20 10:51:09 +0100
committerAmar Tumballi <amarts@redhat.com>2017-11-22 10:12:47 +0000
commitc913a6e6fcd9ebd962955ba5d51f518b2875eba3 (patch)
tree4fe5e5cdc2512cfee9f3cc3212dbe9b2c4643517 /xlators/features/locks/src/inodelk.c
parent77e3bc671aab2fda68ada53f38ec368b20675f59 (diff)
features/locks: Fix memory leaks
Change-Id: Ic1d2e17a7d14389b6734d1b88bd28c0a2907bbd6 BUG: 1515161 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/inodelk.c')
-rw-r--r--xlators/features/locks/src/inodelk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index a8381adda3d..64ffb00c18c 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -720,9 +720,6 @@ out:
if (ctx)
pthread_mutex_unlock (&ctx->lock);
- if (need_inode_unref)
- inode_unref (pl_inode->inode);
-
/* The following (extra) unref corresponds to the ref that
* was done at the time the lock was granted.
*/
@@ -731,6 +728,10 @@ out:
grant_blocked_inode_locks (this, pl_inode, dom);
}
+ if (need_inode_unref) {
+ inode_unref (pl_inode->inode);
+ }
+
return ret;
}