]> git.hungrycats.org Git - linux/commitdiff
Btrfs: fix fspath error deallocation
authorVincent Stehlé <vincent.stehle@intel.com>
Tue, 10 May 2016 12:56:20 +0000 (14:56 +0200)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Wed, 17 Aug 2016 02:42:09 +0000 (22:42 -0400)
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>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit 72928f2476d08c79f132b4f44a17c9a011dd98e3)

fs/btrfs/backref.c

index 55055a414e8cc64d21d3c6ef6da81685cb718392..be75e4cc523c189a6d969c0fca1cb7715a915eae 100644 (file)
@@ -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);
        }