]> git.hungrycats.org Git - linux/commitdiff
Btrfs: cleanup: remove unnecessary check before btrfs_free_path is called
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>
Wed, 19 Aug 2015 05:55:00 +0000 (14:55 +0900)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Sat, 17 Oct 2015 03:12:51 +0000 (23:12 -0400)
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>
(cherry picked from commit 527afb4493c2892ce89fb74648e72a30b68ba120)
(cherry picked from commit ea0fd8bcc0330dd6589cedc076f12bcb0de91a15)

fs/btrfs/dev-replace.c
fs/btrfs/inode.c
fs/btrfs/tree-defrag.c

index 564a7de17d99831083c46bc19fd859d40a5d51a2..e54dd5905cee177912e03c915a8d471762bfc0cd 100644 (file)
@@ -183,8 +183,7 @@ no_valid_dev_replace_entry_found:
        }
 
 out:
-       if (path)
-               btrfs_free_path(path);
+       btrfs_free_path(path);
        return ret;
 }
 
index f0247f5ae05ff0668192a71220180dc18f4406f6..457218546ac7a45f72b5e60b8fb0e74c113499fe 100644 (file)
@@ -6931,8 +6931,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)
index a4b9c8b2d35ab9d93676588ad426726788f032ce..f31db43253399e032c76d52d6520bbff41907aa6 100644 (file)
@@ -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;