Return-Path: Received: from mail-sn1nam01on0122.outbound.protection.outlook.com ([104.47.32.122]:29472 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754777AbeARVFf (ORCPT ); Thu, 18 Jan 2018 16:05:35 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Guoqing Jiang , Shaohua Li , Sasha Levin Subject: [added to the 4.1 stable tree] md-cluster: free md_cluster_info if node leave cluster Date: Thu, 18 Jan 2018 21:01:23 +0000 Message-ID: <20180118205908.3220-223-alexander.levin@microsoft.com> References: <20180118205908.3220-1-alexander.levin@microsoft.com> In-Reply-To: <20180118205908.3220-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Guoqing Jiang This patch has been added to the stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 9c8043f337f14d1743006dfc59c03e80a42e3884 ] To avoid memory leak, we need to free the cinfo which is allocated when node join cluster. Reviewed-by: NeilBrown Signed-off-by: Guoqing Jiang Signed-off-by: Shaohua Li Signed-off-by: Sasha Levin --- drivers/md/md-cluster.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index fcfc4b9b2672..4eb5cb18f98d 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -738,6 +738,7 @@ static int leave(struct mddev *mddev) lockres_free(cinfo->sb_lock); lockres_free(cinfo->bitmap_lockres); dlm_release_lockspace(cinfo->lockspace, 2); + kfree(cinfo); return 0; } =20 --=20 2.11.0