Skip to content

Commit c87ef46

Browse files
committed
Merge pull request #612 from hjelmn/opal_coverity
opal coverity fixes
2 parents 65472a3 + 7b7993e commit c87ef46

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

opal/mca/btl/openib/btl_openib_endpoint.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -613,13 +613,13 @@ void mca_btl_openib_endpoint_connected(mca_btl_openib_endpoint_t *endpoint)
613613
opal_progress_event_users_decrement();
614614

615615
if(MCA_BTL_XRC_ENABLED) {
616-
while(master && !opal_list_is_empty(&endpoint->ib_addr->pending_ep)) {
617-
ep_item = opal_list_remove_first(&endpoint->ib_addr->pending_ep);
618-
ep = (mca_btl_openib_endpoint_t *)ep_item;
619-
if (OPAL_SUCCESS !=
620-
opal_btl_openib_connect_base_start(endpoint->endpoint_local_cpc,
621-
ep)) {
622-
BTL_ERROR(("Failed to connect pending endpoint\n"));
616+
if (master) {
617+
while (NULL != (ep_item = opal_list_remove_first(&endpoint->ib_addr->pending_ep))) {
618+
ep = (mca_btl_openib_endpoint_t *)ep_item;
619+
if (OPAL_SUCCESS !=
620+
opal_btl_openib_connect_base_start(endpoint->endpoint_local_cpc, ep)) {
621+
BTL_ERROR(("Failed to connect pending endpoint\n"));
622+
}
623623
}
624624
}
625625
OPAL_THREAD_UNLOCK(&endpoint->ib_addr->addr_lock);

opal/mca/pmix/base/pmix_base_fns.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
3+
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
44
* reserved.
55
* Copyright (c) 2014 Intel, Inc. All rights reserved.
66
* Copyright (c) 2014-2015 Research Organization for Information Science
@@ -424,11 +424,7 @@ int opal_pmix_base_cache_keys_locally(const opal_process_name_t* id, const char*
424424
kv->data.byte = *tmp3;
425425
break;
426426
case OPAL_STRING:
427-
if (NULL != tmp3) {
428-
kv->data.string = strdup(tmp3);
429-
} else {
430-
kv->data.string = NULL;
431-
}
427+
kv->data.string = strdup(tmp3);
432428
break;
433429
case OPAL_PID:
434430
kv->data.pid = strtoul(tmp3, NULL, 10);

opal/mca/pmix/native/pmix_native.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014 Mellanox Technologies, Inc.
77
* All rights reserved.
8+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
9+
* reserved.
810
* $COPYRIGHT$
911
*
1012
* Additional copyrights may follow
@@ -699,10 +701,12 @@ static void fencenb_cbfunc(opal_buffer_t *buf, void *cbdata)
699701
}
700702

701703
/* if a callback was provided, execute it */
702-
if (NULL != cb && NULL != cb->cbfunc) {
703-
cb->cbfunc(rc, NULL, cb->cbdata);
704+
if (NULL != cb) {
705+
if (NULL != cb->cbfunc) {
706+
cb->cbfunc(rc, NULL, cb->cbdata);
707+
}
708+
OBJ_RELEASE(cb);
704709
}
705-
OBJ_RELEASE(cb);
706710
}
707711

708712
static int native_fence_nb(opal_process_name_t *procs, size_t nprocs,

0 commit comments

Comments
 (0)