1
1

mtl/ofi: Fix crash if no providers found

Commit 109d0569ffd 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>
(cherry picked from commit 6e15128d960aaa40dd7e905ae3e9e53d9cdaac2a)
Signed-off-by: Brian Barrett <bbarrett@amazon.com>
Этот коммит содержится в:
Brian Barrett 2018-12-11 21:23:24 +00:00
родитель 22d0857ee5
Коммит 4b293d3823

Просмотреть файл

@ -927,6 +927,7 @@ error:
(void) fi_close((fid_t)ompi_mtl_ofi.av);
}
if ((false == ompi_mtl_ofi.sep_supported) &&
ompi_mtl_ofi.ofi_ctxt != NULL &&
ompi_mtl_ofi.ofi_ctxt[0].cq) {
/* Check if CQ[0] was created for non-SEP case and close if needed */
(void) fi_close((fid_t)ompi_mtl_ofi.ofi_ctxt[0].cq);