Skip to content

Commit

Permalink
NA OFI: check against FI_REMOTE_CQ_DATA before accessing cq_event->data
Browse files Browse the repository at this point in the history
  • Loading branch information
soumagne committed Dec 20, 2024
1 parent 54263f2 commit 223c9ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/na/na_ofi.c
Original file line number Diff line number Diff line change
Expand Up @@ -6801,11 +6801,15 @@ na_ofi_cq_process_event(struct na_ofi_class *na_ofi_class,
&na_ofi_op_id->completion_data->callback_info.info
.recv_unexpected,
na_ofi_op_id->info.msg.buf.ptr, cq_event->len, na_ofi_addr,
(cq_event->data > 0) ? cq_event->data : cq_event->tag);
(cq_event->flags & FI_REMOTE_CQ_DATA) ? cq_event->data
: cq_event->tag);
NA_CHECK_SUBSYS_NA_ERROR(
msg, error, ret, "Could not process unexpected recv event");
break;
case NA_CB_MULTI_RECV_UNEXPECTED:
NA_CHECK_SUBSYS_ERROR(msg, !(cq_event->flags & FI_REMOTE_CQ_DATA),
error, ret, NA_INVALID_ARG,
"FI_REMOTE_CQ_DATA not set in completion event");
complete = cq_event->flags & FI_MULTI_RECV;

ret = na_ofi_cq_process_multi_recv_unexpected(na_ofi_class,
Expand Down

0 comments on commit 223c9ca

Please sign in to comment.