]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Btrfs: fix fspath error deallocation
authorVincent Stehlé <vincent.stehle@intel.com>
Tue, 10 May 2016 12:56:20 +0000 (14:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jun 2016 01:18:55 +0000 (18:18 -0700)
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é <vincent.stehle@intel.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/backref.c

index f6dac40f87ff5d4022559e6701b506589aad0353..6442a31c2119b1e98d09ec176bbcc12cc05a6554 100644 (file)
@@ -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);
        }