Skip to content

Commit 527afb4

Browse files
Tsutomu Itohmasoncl
authored andcommitted
Btrfs: cleanup: remove unnecessary check before btrfs_free_path is called
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>
1 parent c6dd6ea commit 527afb4

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

fs/btrfs/dev-replace.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,7 @@ int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info)
183183
}
184184

185185
out:
186-
if (path)
187-
btrfs_free_path(path);
186+
btrfs_free_path(path);
188187
return ret;
189188
}
190189

fs/btrfs/inode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6905,8 +6905,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
69056905

69066906
trace_btrfs_get_extent(root, em);
69076907

6908-
if (path)
6909-
btrfs_free_path(path);
6908+
btrfs_free_path(path);
69106909
if (trans) {
69116910
ret = btrfs_end_transaction(trans, root);
69126911
if (!err)

fs/btrfs/tree-defrag.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
115115
ret = -EAGAIN;
116116
}
117117
out:
118-
if (path)
119-
btrfs_free_path(path);
118+
btrfs_free_path(path);
120119
if (ret == -EAGAIN) {
121120
if (root->defrag_max.objectid > root->defrag_progress.objectid)
122121
goto done;

0 commit comments

Comments
 (0)