summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2017-02-24 11:15:12 +0800
committerShaohua Li <shli@fb.com>2017-03-09 09:01:47 -0800
commit9c8043f337f14d1743006dfc59c03e80a42e3884 (patch)
tree1934109184f04fc891ed6ce6bea30fdde3ef85d4
parent99b3d74ec05c4a4c57766a90d65b53d78ab06404 (diff)
md-cluster: free md_cluster_info if node leave cluster
To avoid memory leak, we need to free the cinfo which is allocated when node join cluster. Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r--drivers/md/md-cluster.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index 2b13117fb918..ba7edcdd09ce 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -974,6 +974,7 @@ static int leave(struct mddev *mddev)
lockres_free(cinfo->bitmap_lockres);
unlock_all_bitmaps(mddev);
dlm_release_lockspace(cinfo->lockspace, 2);
+ kfree(cinfo);
return 0;
}