diff --git a/src/common/slurm_acct_gather_profile.c b/src/common/slurm_acct_gather_profile.c
index 952a7ff86e9ec8a055efc19daa719b0b980ac3d0..cc24d6ff81afe0787a64ec2b05ed6f8e3a62cbd3 100644
--- a/src/common/slurm_acct_gather_profile.c
+++ b/src/common/slurm_acct_gather_profile.c
@@ -199,7 +199,7 @@ extern int acct_gather_profile_fini(void)
 
 	slurm_mutex_lock(&g_context_lock);
 
-	if (g_context)
+	if (!g_context)
 		goto done;
 
 	init_run = false;