From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:51532 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932314AbcFCPnS (ORCPT ); Fri, 3 Jun 2016 11:43:18 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B21E4AC71 for ; Fri, 3 Jun 2016 15:43:16 +0000 (UTC) From: David Sterba To: stable@vger.kernel.org Subject: [PATCH 14/21] Btrfs: fix fspath error deallocation Date: Fri, 3 Jun 2016 17:42:37 +0200 Message-Id: <1464968557-6815-1-git-send-email-dsterba@suse.com> In-Reply-To: <20160603154006.GP29147@suse.cz> References: <20160603154006.GP29147@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: From: Vincent Stehlé commit 72928f2476d08c79f132b4f44a17c9a011dd98e3 upstream. Make sure to deallocate fspath with vfree() in case of error in init_ipath(). fspath is allocated with vmalloc() in init_data_container() since commit 425d17a290c0 ("Btrfs: use larger limit for translation of logical to inode"). Signed-off-by: Vincent Stehlé Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/backref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index f6dac40f87ff..6442a31c2119 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -1995,7 +1995,7 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct btrfs_root *fs_root, ifp = kmalloc(sizeof(*ifp), GFP_NOFS); if (!ifp) { - kfree(fspath); + vfree(fspath); return ERR_PTR(-ENOMEM); } -- 2.7.1