1
1

Correct some issues with variables used before being set

Этот коммит содержится в:
Ralph Castain 2014-12-12 17:23:00 -08:00
родитель 0630680f36
Коммит bffb2b7a4b
3 изменённых файлов: 16 добавлений и 9 удалений

Просмотреть файл

@ -129,7 +129,6 @@ static int store(struct opal_dstore_base_module_t *imod,
opal_value_t *val)
{
mca_dstore_sm_module_t *mod;
int rc;
void *addr;
int32_t data_size;
opal_shmem_ds_t *seg_ds;
@ -213,18 +212,17 @@ static int store(struct opal_dstore_base_module_t *imod,
ch = strrchr(path, OPAL_PATH_SEP[0]) + 1;
if (NULL != ch) {
*ch = '\0';
rc = asprintf(&sm_file, "%sdstore_segment.%d", path, cur_seg_index);
(void)asprintf(&sm_file, "%sdstore_segment.%d", path, cur_seg_index);
}
free(path);
}
if (NULL == sm_file) {
rc = asprintf(&sm_file, "%s", "noname");
(void)asprintf(&sm_file, "%s", "noname");
}
if (0 <= rc && NULL != sm_file) {
if (NULL != sm_file) {
seg_ds = (opal_shmem_ds_t*)malloc(sizeof(opal_shmem_ds_t));
memset(seg_ds, 0, sizeof(opal_shmem_ds_t));
rc = opal_shmem_segment_create (seg_ds, sm_file, SHARED_SEGMENT_SIZE);
if (OPAL_SUCCESS != rc) {
if (OPAL_SUCCESS != opal_shmem_segment_create (seg_ds, sm_file, SHARED_SEGMENT_SIZE)) {
opal_output_verbose(0, opal_dstore_base_framework.framework_output,
"%s dstore:sm:store: couldn't create new shared segment to store key %s on proc %s",
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),

Просмотреть файл

@ -1221,9 +1221,9 @@ static void pmix_server_dmdx_resp(int status, orte_process_name_t* sender,
/* pass across any returned blobs */
opal_dss.copy_payload(reply, buffer);
stored = true;
}
OBJ_RETAIN(reply);
PMIX_SERVER_QUEUE_SEND(req->peer, req->tag, reply);
}
} else {
/* If peer has an access to shared memory dstore, check
* if we already stored data for the target process.

Просмотреть файл

@ -1249,6 +1249,7 @@ static void process_message(pmix_server_peer_t *peer)
ORTE_NAME_PRINT(&name));
kvp = NULL;
kvp2 = NULL;
data = NULL;
/* retrieve the local blob for that proc */
OBJ_CONSTRUCT(&values, opal_list_t);
if (OPAL_SUCCESS == (ret = opal_dstore.fetch(pmix_server_local_handle, &idreq, "modex", &values))) {
@ -1297,7 +1298,9 @@ static void process_message(pmix_server_peer_t *peer)
return;
}
} else {
if (NULL == data) {
data = OBJ_NEW(opal_buffer_t);
}
if (OPAL_SUCCESS != (rc = opal_dss.pack(data, &bptr, 1, OPAL_BUFFER))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(reply);
@ -1334,6 +1337,9 @@ static void process_message(pmix_server_peer_t *peer)
return;
}
} else {
if (NULL == data) {
data = OBJ_NEW(opal_buffer_t);
}
if (OPAL_SUCCESS != (rc = opal_dss.pack(data, &bptr, 1, OPAL_BUFFER))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(reply);
@ -1372,6 +1378,9 @@ static void process_message(pmix_server_peer_t *peer)
return;
}
} else {
if (NULL == data) {
data = OBJ_NEW(opal_buffer_t);
}
if (OPAL_SUCCESS != (rc = opal_dss.pack(data, &bptr, 1, OPAL_BUFFER))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(reply);