Skip to content

Commit

Permalink
Fix rejected event initialization
Browse files Browse the repository at this point in the history
The rejected event initialization referred to itself. The updated
compiler apparently does not guarantee  ordering for static
initializers.
  • Loading branch information
tom95858 committed Dec 14, 2020
1 parent 0733170 commit 7dc8f65
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/src/zap/ugni/zap_ugni.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,13 +888,14 @@ static void process_uep_msg_rejected(struct z_ugni_ep *uep)
{
struct zap_ugni_msg_regular *msg;
int rc;
size_t data_len;

msg = (void*)uep->rbuff->data;

data_len = ntohl(msg->data_len);
struct zap_event ev = {
.type = ZAP_EVENT_REJECTED,
.data_len = ntohl(msg->data_len),
.data = (ev.data_len ? (void*)msg->data : NULL)
.data_len = data_len,
.data = (data_len ? (void *)msg->data : NULL)
};
rc = zap_ep_change_state(&uep->ep, ZAP_EP_CONNECTING, ZAP_EP_ERROR);
if (rc != ZAP_ERR_OK) {
Expand Down

0 comments on commit 7dc8f65

Please sign in to comment.