Skip to content

Commit 72b9918

Browse files
elfringtorvalds
authored andcommitted
nilfs2: deletion of an unnecessary check before the function call "iput"
The iput() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 75dc857 commit 72b9918

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎fs/nilfs2/the_nilfs.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,7 @@ void nilfs_put_root(struct nilfs_root *root)
808808
spin_lock(&nilfs->ns_cptree_lock);
809809
rb_erase(&root->rb_node, &nilfs->ns_cptree);
810810
spin_unlock(&nilfs->ns_cptree_lock);
811-
if (root->ifile)
812-
iput(root->ifile);
811+
iput(root->ifile);
813812

814813
kfree(root);
815814
}

0 commit comments

Comments
 (0)