From a0cb347ceac4840e988fc6148db21bffbf80cb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Thu, 20 May 2021 22:29:33 +0200 Subject: [PATCH] libzfs_core: fini: don't check for refcount twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Reviewed-by: John Kennedy Signed-off-by: Ahelenia ZiemiaƄska Closes #12094 --- lib/libzfs_core/libzfs_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libzfs_core/libzfs_core.c b/lib/libzfs_core/libzfs_core.c index 1e6bbcd561fa..7a71b7a54588 100644 --- a/lib/libzfs_core/libzfs_core.c +++ b/lib/libzfs_core/libzfs_core.c @@ -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);