aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ecryptfs/dentry.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c
index 329efcd3d8c9..cb20b964419f 100644
--- a/fs/ecryptfs/dentry.c
+++ b/fs/ecryptfs/dentry.c
@@ -78,18 +78,13 @@ struct kmem_cache *ecryptfs_dentry_info_cache;
78 */ 78 */
79static void ecryptfs_d_release(struct dentry *dentry) 79static void ecryptfs_d_release(struct dentry *dentry)
80{ 80{
81 struct dentry *lower_dentry; 81 if (ecryptfs_dentry_to_private(dentry)) {
82 82 if (ecryptfs_dentry_to_lower(dentry)) {
83 lower_dentry = ecryptfs_dentry_to_lower(dentry); 83 mntput(ecryptfs_dentry_to_lower_mnt(dentry));
84 if (ecryptfs_dentry_to_private(dentry)) 84 dput(ecryptfs_dentry_to_lower(dentry));
85 }
85 kmem_cache_free(ecryptfs_dentry_info_cache, 86 kmem_cache_free(ecryptfs_dentry_info_cache,
86 ecryptfs_dentry_to_private(dentry)); 87 ecryptfs_dentry_to_private(dentry));
87 if (lower_dentry) {
88 struct vfsmount *lower_mnt =
89 ecryptfs_dentry_to_lower_mnt(dentry);
90
91 mntput(lower_mnt);
92 dput(lower_dentry);
93 } 88 }
94 return; 89 return;
95} 90}