Skip to content

Commit 23fe4f7

Browse files
committed
ompi/instant CID 1516780: remove double unlock
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 9d68f46 commit 23fe4f7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ompi/instance/instance.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*
33
* Copyright (c) 2018-2022 Triad National Security, LLC. All rights
44
* reserved.
5+
* Copyright (c) 2022 Cisco Systems, Inc. All rights reserved.
56
* $COPYRIGHT$
67
*
78
* Additional copyrights may follow
@@ -818,10 +819,10 @@ int ompi_mpi_instance_init (int ts_level, opal_info_t *info, ompi_errhandler_t
818819
new_instance = OBJ_NEW(ompi_instance_t);
819820
if (OPAL_UNLIKELY(NULL == new_instance)) {
820821
if (0 == opal_atomic_add_fetch_32 (&ompi_instance_count, -1)) {
821-
ret = ompi_mpi_instance_finalize_common ();
822-
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
823-
opal_mutex_unlock (&instance_lock);
824-
}
822+
// We can't do anything if an error occurs here because
823+
// we're already in an error path, so don't even bother to
824+
// look at the return value.
825+
(void) ompi_mpi_instance_finalize_common ();
825826
}
826827
opal_mutex_unlock (&instance_lock);
827828
return OMPI_ERR_OUT_OF_RESOURCE;

0 commit comments

Comments
 (0)