Add comments about order of close ops
Per suggestion of @awlauria, added some comments about the need to free ep before resources it points to. Signed-off-by: Harumi Kuno <harumi.kuno@hpe.com> (cherry picked from commit 1bc3dab118bb694d932ef365a7a922e514f82a20) Signed-off-by: Brian Barrett <bbarrett@amazon.com>
Этот коммит содержится в:
родитель
bb57080c84
Коммит
faaaf5ca1c
@ -578,6 +578,7 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
|
||||
fail:
|
||||
/* clean up */
|
||||
|
||||
/* close basic ep before closing av */
|
||||
if (NULL != ep && !module->is_scalable_ep) {
|
||||
fi_close(&ep->fid);
|
||||
}
|
||||
@ -589,10 +590,12 @@ fail:
|
||||
}
|
||||
free(module->contexts);
|
||||
|
||||
/* check for NULL ep to avoid double-close */
|
||||
if (NULL != ep) {
|
||||
fi_close(&ep->fid);
|
||||
}
|
||||
|
||||
/* close av after closing basic ep */
|
||||
if (NULL != av) {
|
||||
fi_close(&av->fid);
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ int mca_btl_ofi_finalize (mca_btl_base_module_t* btl)
|
||||
ofi_btl->rcache = NULL;
|
||||
}
|
||||
|
||||
/* For a standard ep, we need to close the ep first. */
|
||||
/* Close basic ep before closing its attached resources. */
|
||||
if (NULL != ofi_btl->ofi_endpoint && !ofi_btl->is_scalable_ep) {
|
||||
fi_close(&ofi_btl->ofi_endpoint->fid);
|
||||
ofi_btl->ofi_endpoint = NULL;
|
||||
@ -297,6 +297,7 @@ int mca_btl_ofi_finalize (mca_btl_base_module_t* btl)
|
||||
fi_close(&ofi_btl->ofi_endpoint->fid);
|
||||
}
|
||||
|
||||
/* close ep before closing av */
|
||||
if (NULL != ofi_btl->av) {
|
||||
fi_close(&ofi_btl->av->fid);
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user