]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Btrfs: fix fspath error deallocation
authorVincent Stehlé <vincent.stehle@intel.com>
Tue, 10 May 2016 12:56:20 +0000 (14:56 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 10 May 2016 14:22:26 +0000 (16:22 +0200)
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>
fs/btrfs/backref.c

index 80e8472d618b83f397baca30508aa76e69e652c6..d3090187fd76d0f65010e6184dbda48fb8114af8 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);
        }