Skip to content

Commit

Permalink
Merge pull request #1161 from ggouaillardet/topic/v1.10/openib_error_…
Browse files Browse the repository at this point in the history
…path_cleanup

btl/openib: fix error path in init_one_device()
  • Loading branch information
rhc54 committed May 19, 2016
2 parents db7e874 + df1878c commit ca688f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
21 changes: 4 additions & 17 deletions ompi/mca/btl/openib/btl_openib_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,6 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev)

port_cnt = get_port_list(device, allowed_ports);
if (0 == port_cnt) {
free(allowed_ports);
ret = OMPI_SUCCESS;
++num_devices_intentionally_ignored;
goto error;
Expand Down Expand Up @@ -1801,6 +1800,7 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev)
}
}
free(allowed_ports);
allowed_ports = NULL;

/* If we made a BTL, check APM status and return. Otherwise, fall
through and destroy everything */
Expand Down Expand Up @@ -2115,28 +2115,15 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev)
}

error:
#if OMPI_ENABLE_PROGRESS_THREADS
if (device->ib_channel) {
ibv_destroy_comp_channel(device->ib_channel);
}
#endif
if (device->mpool) {
mca_mpool_base_module_destroy(device->mpool);
}

if (device->ib_pd) {
ibv_dealloc_pd(device->ib_pd);
}

if (OMPI_SUCCESS != ret) {
opal_show_help("help-mpi-btl-openib.txt",
"error in device init", true,
ompi_process_info.nodename,
ibv_get_device_name(device->ib_dev));
}

if (device->ib_dev_context) {
ibv_close_device(device->ib_dev_context);
if (NULL != allowed_ports) {
free(allowed_ports);
}
OBJ_RELEASE(device);
return ret;
Expand Down Expand Up @@ -2398,7 +2385,7 @@ btl_openib_component_init(int *num_btl_modules,
bool enable_mpi_threads)
{
struct ibv_device **ib_devs;
mca_btl_base_module_t** btls;
mca_btl_base_module_t** btls = NULL;
int i, ret, num_devs, length;
opal_list_t btl_list;
mca_btl_openib_module_t * openib_btl;
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/btl/openib/connect/btl_openib_connect_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ int ompi_btl_openib_connect_base_select_for_local_port(mca_btl_openib_module_t *
}
msg = (char *) malloc(len);
if (NULL == msg) {
free(cpcs);
return OMPI_ERR_OUT_OF_RESOURCE;
}
msg[0] = '\0';
Expand Down

0 comments on commit ca688f3

Please sign in to comment.