diff options
author | Filipe David Borba Manana <fdmanana@gmail.com> | 2013-07-30 12:09:55 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2013-08-09 14:32:37 +0200 |
commit | 2b2201bd094dd1d8d0ab2d119f36e107591f10c1 (patch) | |
tree | 19d2d82883076b5d7c486ac381fa36c3b567d1dd /extent-tree.c | |
parent | af6c1650cf38395143157a674344e195d47c0517 (diff) |
Btrfs-progs: add missing path alloc return value check
Also remove unused path in extent-tree.c:finish_current_insert().
Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'extent-tree.c')
-rw-r--r-- | extent-tree.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/extent-tree.c b/extent-tree.c index 9f1ca604..35fd82e2 100644 --- a/extent-tree.c +++ b/extent-tree.c @@ -1483,6 +1483,8 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, } path = btrfs_alloc_path(); + if (!path) + return -ENOMEM; path->reada = 1; key.objectid = bytenr; @@ -1574,6 +1576,8 @@ int btrfs_set_block_flags(struct btrfs_trans_handle *trans, BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA); path = btrfs_alloc_path(); + if (!path) + return -ENOMEM; path->reada = 1; key.objectid = bytenr; @@ -2075,7 +2079,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, u64 end; u64 priv; struct btrfs_fs_info *info = extent_root->fs_info; - struct btrfs_path *path; struct pending_extent_op *extent_op; struct btrfs_key key; int ret; @@ -2083,8 +2086,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, btrfs_fs_incompat(extent_root->fs_info, BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA); - path = btrfs_alloc_path(); - while(1) { ret = find_first_extent_bit(&info->extent_ins, 0, &start, &end, EXTENT_LOCKED); @@ -2119,7 +2120,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, GFP_NOFS); kfree(extent_op); } - btrfs_free_path(path); return 0; } |