} else {
/* see if there is an EP connected with this CM handle */
ep_ptr = dapli_get_sp_ep(ib_cm_handle, sp_ptr, dat_event_num);
+if (ep_ptr != ib_cm_handle->ep)
+ dapl_log(DAPL_DBG_TYPE_ERR, "ep_ptr mismatch!!!\n");
/* if we lost a race with the CM just exit. */
if (ep_ptr == NULL) {
struct ibv_context *context;\r
ibv_device_attr dev_attr;\r
int cnt, i, ret = 0;\r
- uint8_t *ports;\r
+ uint8_t *ports, *port_alloc;\r
size_t port_size;\r
\r
list = ibv_get_device_list(&cnt);\r
}\r
\r
port_size = sizeof(umad_port_t) + sizeof(uint16_t) * UMAD_MAX_PKEYS;\r
- ports = new uint8_t[port_size * dev_attr.phys_port_cnt];\r
- if (ports == NULL) {\r
+ port_alloc = new uint8_t[port_size * dev_attr.phys_port_cnt];\r
+ if (port_alloc == NULL) {\r
ret = -ENOMEM;\r
goto close;\r
}\r
umad_convert_ca_attr(ca, &dev_attr);\r
memset(ca->ports, 0, sizeof(ca->ports));\r
\r
- for (i = 1; i <= dev_attr.phys_port_cnt; i++, ports += port_size) {\r
+ for (i = 1, ports = port_alloc; i <= dev_attr.phys_port_cnt;\r
+ i++, ports += port_size) {\r
\r
ca->ports[i] = (umad_port_t *) ports;\r
strcpy(ca->ports[i]->ca_name, ca_name);\r
\r
ret = umad_query_port(context, ca->ports[i]);\r
if (ret != 0) {\r
- delete ports;\r
+ delete port_alloc;\r
goto close;\r
}\r
}\r