md-cluster: free md_cluster_info if node leave cluster
authorGuoqing Jiang <gqjiang@suse.com>
Fri, 24 Feb 2017 03:15:12 +0000 (11:15 +0800)
committerShaohua Li <shli@fb.com>
Thu, 9 Mar 2017 17:01:47 +0000 (09:01 -0800)
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>
drivers/md/md-cluster.c

index 2b13117fb918cbe27775ba61cc68c6f78e5408ff..ba7edcdd09cec7f607d7b9f203ba5417fe20f10d 100644 (file)
@@ -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;
 }