summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2017-02-24 11:15:12 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-20 10:04:52 +0100
commit0d0456ec2b089457233f4a33c9939dfeff11fbbd (patch)
treede7d3de11bd4c5ccc51b7130df07d9dce5b37787
parenta1d72bc18e776f8c5fc5918fc4f4a2795f31a416 (diff)
downloadlinux-stable-0d0456ec2b089457233f4a33c9939dfeff11fbbd.tar.gz
linux-stable-0d0456ec2b089457233f4a33c9939dfeff11fbbd.tar.bz2
linux-stable-0d0456ec2b089457233f4a33c9939dfeff11fbbd.zip
md-cluster: free md_cluster_info if node leave cluster
[ Upstream commit 9c8043f337f14d1743006dfc59c03e80a42e3884 ] 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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 d6a1126d85ce..494d01d0e92a 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -821,6 +821,7 @@ static int leave(struct mddev *mddev)
lockres_free(cinfo->no_new_dev_lockres);
lockres_free(cinfo->bitmap_lockres);
dlm_release_lockspace(cinfo->lockspace, 2);
+ kfree(cinfo);
return 0;
}