Skip to content

Commit c3491ec

Browse files
elfringtorvalds
authored andcommitted
zsmalloc: Delete an unnecessary check before the function call "iput"
iput() 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. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Markus Elfring <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Acked-by: Minchan Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent fb399b4 commit c3491ec

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mm/zsmalloc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,8 +2174,7 @@ static int zs_register_migration(struct zs_pool *pool)
21742174
static void zs_unregister_migration(struct zs_pool *pool)
21752175
{
21762176
flush_work(&pool->free_work);
2177-
if (pool->inode)
2178-
iput(pool->inode);
2177+
iput(pool->inode);
21792178
}
21802179

21812180
/*

0 commit comments

Comments
 (0)