lkml.org 
[lkml]   [2022]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ceph: fix memory leak in mount error path when using test_dummy_encryption
Date
Because ceph_init_fs_context() will never be invoced in case we get a
mount error, destroy_mount_options() won't be releasing fscrypt resources
with fscrypt_free_dummy_policy(). This will result in a memory leak. Add
an invocation to this function in the mount error path.

Signed-off-by: Luís Henriques <lhenriques@suse.de>
---
fs/ceph/super.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 2224d44d21c0..6b9fd04b25cd 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -1362,6 +1362,7 @@ static int ceph_get_tree(struct fs_context *fc)

ceph_mdsc_close_sessions(fsc->mdsc);
deactivate_locked_super(sb);
+ fscrypt_free_dummy_policy(&fsc->fsc_dummy_enc_policy);
goto out_final;

out:
\
 
 \ /
  Last update: 2022-11-03 16:36    [W:0.145 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site