From: Liu Bo Date: Wed, 22 Aug 2018 23:36:17 +0000 (+0800) Subject: btrfs: free path at an earlier point in btrfs_get_extent X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c64142807f5a4dcff5c69bfb0868df844b2e87c7;p=openwrt%2Fstaging%2Fblogic.git btrfs: free path at an earlier point in btrfs_get_extent trace_btrfs_get_extent() has nothing to do with path, place btrfs_free_path ahead so that we can unlock path on error. Signed-off-by: Liu Bo Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 97ccc774f13d..f2ce88d65f90 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6979,10 +6979,10 @@ insert: err = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len); write_unlock(&em_tree->lock); out: + btrfs_free_path(path); trace_btrfs_get_extent(root, inode, em); - btrfs_free_path(path); if (err) { free_extent_map(em); return ERR_PTR(err);