Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1398068 > unrolled thread

[PATCH] Btrfs: fix fspath error deallocation

Started byVincent Stehlé <vincent.stehle@intel.com>
First post2016-05-10 15:00 +0200
Last post2016-05-10 15:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Btrfs: fix fspath error deallocation Vincent Stehlé <vincent.stehle@intel.com> - 2016-05-10 15:00 +0200
    Re: [PATCH] Btrfs: fix fspath error deallocation David Sterba <dsterba@suse.cz> - 2016-05-10 15:50 +0200

#1398068 — [PATCH] Btrfs: fix fspath error deallocation

FromVincent Stehlé <vincent.stehle@intel.com>
Date2016-05-10 15:00 +0200
Subject[PATCH] Btrfs: fix fspath error deallocation
Message-ID<rxfqy-2xu-11@gated-at.bofh.it>
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é <vincent.stehle@intel.com>
Cc: Chris Mason <clm@fb.com>
Cc: Josef Bacik <jbacik@fb.com>
Cc: David Sterba <dsterba@suse.com>
---
 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 80e8472..d309018 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1991,7 +1991,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.8.0.rc3

[toc] | [next] | [standalone]


#1398107

FromDavid Sterba <dsterba@suse.cz>
Date2016-05-10 15:50 +0200
Message-ID<rxgcV-3iL-1@gated-at.bofh.it>
In reply to#1398068
On Tue, May 10, 2016 at 02:56:20PM +0200, Vincent Stehlé wrote:
> 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é <vincent.stehle@intel.com>
> Cc: Chris Mason <clm@fb.com>
> Cc: Josef Bacik <jbacik@fb.com>
> Cc: David Sterba <dsterba@suse.com>

Reviewed-by: David Sterba <dsterba@suse.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web