Skip to content

Commit

Permalink
UCP/STREAM: fix ucp_stream_am_handler err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-leksikov committed Jul 14, 2021
1 parent d8c5e65 commit ac26299
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/ucp/stream/stream_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,18 +479,14 @@ ucp_stream_am_handler(void *am_arg, void *am_data, size_t am_length,
ucs_assert(am_length >= sizeof(ucp_stream_am_hdr_t));

ep = ucp_worker_get_ep_by_ptr(worker, data->hdr.ep_ptr);
if (ep == NULL) {
return UCS_ERR_NO_ELEM;
}

ep_ext = ucp_ep_ext_proto(ep);

if (ucs_unlikely(ep->flags & UCP_EP_FLAG_CLOSED)) {
ucs_trace_data("ep %p: stream is invalid", ep);
if (ucs_unlikely((ep == NULL) || (ep->flags & UCP_EP_FLAG_CLOSED))) {
ucs_trace_data("ep %p: stream is invalid, flags=0x%x", ep,
ep == NULL ? 0u : ep->flags);
/* drop the data */
return UCS_OK;
}

ep_ext = ucp_ep_ext_proto(ep);
status = ucp_stream_am_data_process(worker, ep_ext, data,
am_length - sizeof(data->hdr),
am_flags);
Expand Down

0 comments on commit ac26299

Please sign in to comment.