Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCX: do not dereference NULL pointer in wpmem_[free|flush] #8035

Merged
merged 1 commit into from
Sep 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion opal/mca/common/ucx/common_ucx_wpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ static int _comm_ucx_wpmem_map(opal_common_ucx_wpool_t *wpool,
void opal_common_ucx_wpmem_free(opal_common_ucx_wpmem_t *mem)
{
_mem_record_t *mem_rec = NULL, *next;

if (NULL == mem) {
return;
}

OBJ_DESTRUCT(&mem->tls_key);

Expand Down Expand Up @@ -824,9 +828,14 @@ opal_common_ucx_wpmem_flush(opal_common_ucx_wpmem_t *mem,
int target)
{
_ctx_record_t *ctx_rec;
opal_common_ucx_ctx_t *ctx = mem->ctx;
opal_common_ucx_ctx_t *ctx;
int rc = OPAL_SUCCESS;

if (NULL == mem) {
return OPAL_SUCCESS;
}

ctx = mem->ctx;
opal_mutex_lock(&ctx->mutex);

OPAL_LIST_FOREACH(ctx_rec, &ctx->ctx_records, _ctx_record_t) {
Expand Down