From mboxrd@z Thu Jan 1 00:00:00 1970 From: Davidlohr Bueso Subject: [PATCH] omfs: fix memory leak Date: Sat, 03 Jul 2010 22:33:48 -0400 Message-ID: <1278210828.27014.2.camel@cowboy> Reply-To: dave.bueso@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: me@bobcopeland.com, linux-karma-devel@lists.sourceforge.net Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-karma-devel-bounces@lists.sourceforge.net List-Id: linux-fsdevel.vger.kernel.org Hi, In omfs_fill_super(), when returning on error, sbi is not being freed. Thanks, Davidlohr. Signed-off-by: Davidlohr Bueso --- fs/omfs/inode.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 089839a..253846e 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -523,12 +523,14 @@ static int omfs_fill_super(struct super_block *sb, void *data, int silent) } printk(KERN_DEBUG "omfs: Mounted volume %s\n", omfs_rb->r_name); - ret = 0; + ret = 0; /* success */ out_brelse_bh2: brelse(bh2); out_brelse_bh: brelse(bh); end: + if (ret != 0) + kfree(sbi); return ret; } -- 1.7.0.4 ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first