* [PATCH] Btrfs: fix fspath error deallocation
@ 2016-05-10 12:56 Vincent Stehlé
2016-05-10 13:39 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Vincent Stehlé @ 2016-05-10 12:56 UTC (permalink / raw)
To: linux-btrfs
Cc: linux-kernel, Vincent Stehlé,
Chris Mason, Josef Bacik, David Sterba
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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] Btrfs: fix fspath error deallocation
2016-05-10 12:56 [PATCH] Btrfs: fix fspath error deallocation Vincent Stehlé
@ 2016-05-10 13:39 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2016-05-10 13:39 UTC (permalink / raw)
To: Vincent Stehlé
Cc: linux-btrfs, linux-kernel, Chris Mason, Josef Bacik, David Sterba
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-10 13:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10 12:56 [PATCH] Btrfs: fix fspath error deallocation Vincent Stehlé
2016-05-10 13:39 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®