Skip to content

Commit a316399

Browse files
elfringRich Felker
authored andcommitted
sh: Delete unnecessary checks before the function call "mempool_destroy"
The mempool_destroy() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Rich Felker <dalias@libc.org>
1 parent a1e262f commit a316399

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/sh/kernel/dwarf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,10 +1009,8 @@ static void __init dwarf_unwinder_cleanup(void)
10091009
rbtree_postorder_for_each_entry_safe(cie, next_cie, &cie_root, node)
10101010
kfree(cie);
10111011

1012-
if (dwarf_reg_pool)
1013-
mempool_destroy(dwarf_reg_pool);
1014-
if (dwarf_frame_pool)
1015-
mempool_destroy(dwarf_frame_pool);
1012+
mempool_destroy(dwarf_reg_pool);
1013+
mempool_destroy(dwarf_frame_pool);
10161014
kmem_cache_destroy(dwarf_reg_cachep);
10171015
kmem_cache_destroy(dwarf_frame_cachep);
10181016
}

0 commit comments

Comments
 (0)