Skip to content

Commit

Permalink
Btrfs: cleanup: remove unnecessary check before btrfs_free_path is ca…
Browse files Browse the repository at this point in the history
…lled

We need not check path before btrfs_free_path() is called because
path is checked in btrfs_free_path().

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
Tsutomu Itoh authored and Chris Mason committed Aug 31, 2015
1 parent c6dd6ea commit 527afb4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions fs/btrfs/dev-replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info)
}

out:
if (path)
btrfs_free_path(path);
btrfs_free_path(path);
return ret;
}

Expand Down
3 changes: 1 addition & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -6905,8 +6905,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,

trace_btrfs_get_extent(root, em);

if (path)
btrfs_free_path(path);
btrfs_free_path(path);
if (trans) {
ret = btrfs_end_transaction(trans, root);
if (!err)
Expand Down
3 changes: 1 addition & 2 deletions fs/btrfs/tree-defrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
ret = -EAGAIN;
}
out:
if (path)
btrfs_free_path(path);
btrfs_free_path(path);
if (ret == -EAGAIN) {
if (root->defrag_max.objectid > root->defrag_progress.objectid)
goto done;
Expand Down

0 comments on commit 527afb4

Please sign in to comment.