libzfs_core: fini: don't check for refcount twice

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12094
This commit is contained in:
наб 2021-05-20 22:29:33 +02:00 committed by Brian Behlendorf
parent c71a2bb52f
commit a0cb347cea

View File

@ -158,8 +158,7 @@ libzfs_core_fini(void)
(void) pthread_mutex_lock(&g_lock);
ASSERT3S(g_refcount, >, 0);
if (g_refcount > 0)
g_refcount--;
g_refcount--;
if (g_refcount == 0 && g_fd != -1) {
(void) close(g_fd);