Skip to content

Commit 2680647

Browse files
committed
[v2.2.x] prov/efa: Initialize pke->addr to FI_ADDR_NOTAVAIL
This fixes an ostensibly long-standing bug, where pke->addr could be uninitialized (garbage), which naturally causes issues when passed to utility functions like efa_rdm_ep_get_peer(). Signed-off-by: Darryl Abbate <[email protected]>
1 parent b3e697d commit 2680647

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

prov/efa/src/rdm/efa_rdm_pke.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct efa_rdm_pke *efa_rdm_pke_alloc(struct efa_rdm_ep *ep,
6464
* should be adjusted according to the actual data size.
6565
*/
6666
pkt_entry->pkt_size = pkt_pool->attr.size - sizeof(struct efa_rdm_pke);
67+
pkt_entry->addr = FI_ADDR_NOTAVAIL;
6768
pkt_entry->alloc_type = alloc_type;
6869
pkt_entry->flags = EFA_RDM_PKE_IN_USE;
6970
pkt_entry->next = NULL;

prov/efa/test/efa_unit_test_cq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ void test_ibv_cq_ex_read_bad_recv_status(struct efa_resource **state)
449449
numaddr = fi_av_insert(resource->av, &raw_addr, 1, &peer_addr, 0, NULL);
450450
assert_int_equal(numaddr, 1);
451451

452+
pkt_entry->addr = peer_addr;
453+
452454
ibv_cqx->start_poll = &efa_mock_ibv_start_poll_return_mock;
453455
ibv_cqx->end_poll = &efa_mock_ibv_end_poll_check_mock;
454456
ibv_cqx->read_opcode = &efa_mock_ibv_read_opcode_return_mock;

0 commit comments

Comments
 (0)