Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751345AbdFYMub (ORCPT ); Sun, 25 Jun 2017 08:50:31 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:8378 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbdFYMua (ORCPT ); Sun, 25 Jun 2017 08:50:30 -0400 From: piaojun To: , CC: , "ocfs2-devel@oss.oracle.com" Subject: [PATCH] ocfs2: free 'dummy_sc' in sc_fop_release() in case of memory leak Message-ID: <594FB0A4.2050105@huawei.com> Date: Sun, 25 Jun 2017 20:46:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.253.249] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0206.594FB0AD.009A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 4fa18742db11022f8fb1a86296df50e1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 624 Lines: 21 'sd->dbg_sock' is malloc in sc_common_open(), but not freed at the end of sc_fop_release(). Signed-off-by: Jun Piao --- fs/ocfs2/cluster/netdebug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c index 564c504..74a21f6 100644 --- a/fs/ocfs2/cluster/netdebug.c +++ b/fs/ocfs2/cluster/netdebug.c @@ -426,6 +426,7 @@ static int sc_fop_release(struct inode *inode, struct file *file) struct o2net_sock_container *dummy_sc = sd->dbg_sock; o2net_debug_del_sc(dummy_sc); + kfree(dummy_sc); return seq_release_private(inode, file); } --