btrfs: remove unnecessary check of iput argument
authorLv Ruyi <lv.ruyi@zte.com.cn>
Mon, 11 Apr 2022 03:22:52 +0000 (03:22 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:03:12 +0000 (17:03 +0200)
iput() already handles NULL and non-NULL parameter, so it is not needed
to check that. This unifies all iput calls.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c
fs/btrfs/tree-log.c

index 50bdd82..edddd93 100644 (file)
@@ -3846,8 +3846,7 @@ out:
        btrfs_end_transaction(trans);
        btrfs_btree_balance_dirty(fs_info);
        if (err) {
-               if (inode)
-                       iput(inode);
+               iput(inode);
                inode = ERR_PTR(err);
        }
        return inode;
index 0054bde..370388f 100644 (file)
@@ -894,8 +894,7 @@ update_inode:
        btrfs_update_inode_bytes(BTRFS_I(inode), nbytes, drop_args.bytes_found);
        ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
 out:
-       if (inode)
-               iput(inode);
+       iput(inode);
        return ret;
 }