浏览代码

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>
Tsutomu Itoh 10 年之前
父节点
当前提交
527afb4493
共有 3 个文件被更改,包括 3 次插入6 次删除
  1. 1 2
      fs/btrfs/dev-replace.c
  2. 1 2
      fs/btrfs/inode.c
  3. 1 2
      fs/btrfs/tree-defrag.c

+ 1 - 2
fs/btrfs/dev-replace.c

@@ -183,8 +183,7 @@ no_valid_dev_replace_entry_found:
 	}
 
 out:
-	if (path)
-		btrfs_free_path(path);
+	btrfs_free_path(path);
 	return ret;
 }
 

+ 1 - 2
fs/btrfs/inode.c

@@ -6905,8 +6905,7 @@ out:
 
 	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)

+ 1 - 2
fs/btrfs/tree-defrag.c

@@ -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;