if (ret) {
fprintf(stderr, PFX "Fatal: unable to query RDMA device\n");
ret = ERR(ret);
- goto err3;
+ goto err2;
}
cma_dev->port_cnt = attr.phys_port_cnt;
pthread_mutex_unlock(&mut);
return 0;
-err1:
+err2:
ibv_close_device(cma_dev->verbs);
cma_dev->verbs = NULL;
err1:
goto err2;
}
- cma_dev_array = calloc(dev_cnt, sizeof *cma_dev);
+ cma_dev_array = calloc(dev_cnt, sizeof *cma_dev_array);
if (!cma_dev_array) {
ret = ERR(ENOMEM);
goto err2;
goto err1;
for (i = 0; i < cma_dev_cnt; i++) {
- ucma_dev_init(cma_dev_array[i]);
- devs[i] = cma_dev_array[i].verbs
+ ucma_dev_init(&cma_dev_array[i]);
+ devs[i] = cma_dev_array[i].verbs;
if (!devs[i])
goto err2;
}