From: Lv Ruyi Date: Mon, 11 Apr 2022 03:22:52 +0000 (+0000) Subject: btrfs: remove unnecessary check of iput argument X-Git-Tag: baikal/mips/sdk6.1~5713^2~85 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=77603130a198178ee9561264ef039ac9d85e0776;p=kernel.git btrfs: remove unnecessary check of iput argument 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 Signed-off-by: Lv Ruyi Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 50bdd82682fa3..edddd93d2118e 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -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; diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 0054bde86aeaf..370388fadf960 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -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; }