Skip to content

Commit d5e580a

Browse files
committed
Protect against uninitialized var
Not sure the compiler is correct in its complaint, but just in case, let's ensure that the variables being used are always initialized. Signed-off-by: Ralph Castain <[email protected]>
1 parent 30ce690 commit d5e580a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/mca/plm/base/plm_base_launch_support.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ void prte_plm_base_daemon_callback(int status, pmix_proc_t *sender, pmix_data_bu
13031303
char *ptr;
13041304
int idx;
13051305
pmix_status_t ret;
1306-
prte_proc_t *daemon = NULL, *dptr;
1306+
prte_proc_t *daemon = NULL, *dptr, *d1;
13071307
prte_job_t *jdata;
13081308
pmix_proc_t dname;
13091309
pmix_data_buffer_t *relay;
@@ -1647,13 +1647,19 @@ void prte_plm_base_daemon_callback(int status, pmix_proc_t *sender, pmix_data_bu
16471647
if (1 == dname.rank) {
16481648
/* process any cached daemons */
16491649
PMIX_CONSTRUCT(&cachelist, pmix_list_t);
1650+
d1 = (prte_proc_t *) pmix_pointer_array_get_item(jdatorted->procs, 1);
1651+
if (NULL == d1) {
1652+
PRTE_ERROR_LOG(PRTE_ERR_NOT_FOUND);
1653+
prted_failed_launch = true;
1654+
goto CLEANUP;
1655+
}
16501656
while (NULL != (dptr = (prte_proc_t*)pmix_list_remove_first(&prte_plm_globals.daemon_cache))) {
16511657
PMIX_OUTPUT_VERBOSE((5, prte_plm_base_framework.framework_output,
16521658
"%s plm:base:prted_daemon_cback processing cached daemon %s",
16531659
PRTE_NAME_PRINT(PRTE_PROC_MY_NAME),
16541660
PRTE_NAME_PRINT(&dptr->name)));
16551661
if (0 == strcmp(dptr->node->topology->sig, sig)) {
1656-
dptr->node->topology = t;
1662+
dptr->node->topology = d1->node->topology;
16571663
dptr->node->available = prte_hwloc_base_filter_cpus(topo);
16581664
prte_hwloc_base_setup_summary(topo);
16591665
jdatorted->num_reported++;

0 commit comments

Comments
 (0)