]> Git Repo - linux.git/commitdiff
gfs2: Fix memory leak when gfs2meta's fs_context is freed
authorAndrew Price <[email protected]>
Fri, 4 Oct 2019 16:51:58 +0000 (11:51 -0500)
committerAndreas Gruenbacher <[email protected]>
Thu, 24 Oct 2019 14:20:43 +0000 (16:20 +0200)
gfs2 and gfs2meta share an ->init_fs_context function which allocates an
args structure stored in fc->fs_private. gfs2 registers a ->free
function to free this memory when the fs_context is cleaned up, but
there was not one registered for gfs2meta, causing a leak.

Register a ->free function for gfs2meta. The existing gfs2_fc_free
function does what we need.

Reported-by: [email protected]
Fixes: 1f52aa08d12f ("gfs2: Convert gfs2 to fs_context")
Signed-off-by: Andrew Price <[email protected]>
Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Andreas Gruenbacher <[email protected]>
fs/gfs2/ops_fstype.c

index 681b44682b0db6a6016303ec515c291720e6ff32..dc61af2c4d5ec6dda669b70de1f5aa6ce6b8507d 100644 (file)
@@ -1600,6 +1600,7 @@ static int gfs2_meta_get_tree(struct fs_context *fc)
 }
 
 static const struct fs_context_operations gfs2_meta_context_ops = {
+       .free        = gfs2_fc_free,
        .get_tree    = gfs2_meta_get_tree,
 };
 
This page took 0.054546 seconds and 4 git commands to generate.