Skip to content

Commit 6e15128

Browse files
committed
mtl/ofi: Fix crash if no providers found
Commit 109d056 introduced a crash when an error occurred before ofi_ctxt was allocated, including when no providers passed the selection logic. Properly check that the pointer is not NULL in the error cleanup code before dereferencing the pointer. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent 6f7fbd1 commit 6e15128

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ompi/mca/mtl/ofi/mtl_ofi_component.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
927927
(void) fi_close((fid_t)ompi_mtl_ofi.av);
928928
}
929929
if ((false == ompi_mtl_ofi.sep_supported) &&
930+
ompi_mtl_ofi.ofi_ctxt != NULL &&
930931
ompi_mtl_ofi.ofi_ctxt[0].cq) {
931932
/* Check if CQ[0] was created for non-SEP case and close if needed */
932933
(void) fi_close((fid_t)ompi_mtl_ofi.ofi_ctxt[0].cq);

0 commit comments

Comments
 (0)