From patchwork Tue Nov 30 13:31:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 366841 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAUDVBVo014920 for ; Tue, 30 Nov 2010 13:31:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752162Ab0K3NbI (ORCPT ); Tue, 30 Nov 2010 08:31:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30241 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967Ab0K3NbH (ORCPT ); Tue, 30 Nov 2010 08:31:07 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAUDV66U031001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 30 Nov 2010 08:31:06 -0500 Received: from perseus.themaw.net (vpn-10-221.rdu.redhat.com [10.11.10.221]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAUDV4g6019833; Tue, 30 Nov 2010 08:31:05 -0500 From: Ian Kent Subject: [PATCH] btrfs - fix memory leak on finding existing super To: linux-btrfs Cc: Josef Bacik Date: Tue, 30 Nov 2010 21:31:03 +0800 Message-ID: <20101130133103.4661.35881.stgit@perseus.themaw.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 30 Nov 2010 13:31:11 +0000 (UTC) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 47bf67c..f5cca1b 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -654,6 +654,8 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags, } btrfs_close_devices(fs_devices); + kfree(fs_info); + kfree(tree_root); } else { char b[BDEVNAME_SIZE];