Skip to content

Commit 0ae3f75

Browse files
author
Ali Mohammed
committed
prov/ucx: use safe dlist_foreach during unmap
Signed-off-by: Ali Mohammed <[email protected]>
1 parent 0682ba4 commit 0ae3f75

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

prov/ucx/src/ucx_domain.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ static int ucx_dom_control(struct fid *fid, int command, void *arg)
5454
struct ucx_mr_pkey *pkey;
5555
struct ucx_mr_rkey *rkey;
5656
struct fi_mr_map_raw *map_raw;
57-
57+
struct dlist_entry *tmp;
58+
5859
switch (command) {
5960
case FI_MAP_RAW_MR:
6061
map_raw = arg;
@@ -85,8 +86,8 @@ static int ucx_dom_control(struct fid *fid, int command, void *arg)
8586
if (pkey->signature != FI_UCX_PKEY_SIGNATURE)
8687
return -FI_EINVAL;
8788

88-
dlist_foreach_container(&pkey->rkey_list, struct ucx_mr_rkey,
89-
rkey, entry) {
89+
dlist_foreach_container_safe(&pkey->rkey_list, struct ucx_mr_rkey,
90+
rkey, entry, tmp) {
9091
FI_DBG(&ucx_prov,FI_LOG_MR,
9192
"UCX/RMA: removed key {%" PRIu64 ":%" PRIu64 "}\n",
9293
rkey->id.owner_addr, rkey->id.key);

0 commit comments

Comments
 (0)