From 023936e84bce80ab90ae1af5438163432f894d3f Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 29 Jul 2015 07:28:08 -0700 Subject: [PATCH] Silence coverity warnings --- ompi/mca/dpm/orte/dpm_orte.c | 4 ++-- opal/util/net.c | 4 ++-- orte/mca/oob/tcp/oob_tcp_connection.c | 4 ++-- orte/mca/plm/base/plm_base_receive.c | 4 ++-- orte/mca/ras/simulator/ras_sim_module.c | 6 +++++- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ompi/mca/dpm/orte/dpm_orte.c b/ompi/mca/dpm/orte/dpm_orte.c index bc0aa2549a..463aa5872a 100644 --- a/ompi/mca/dpm/orte/dpm_orte.c +++ b/ompi/mca/dpm/orte/dpm_orte.c @@ -15,7 +15,7 @@ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2013-2014 Intel, Inc. All rights reserved + * Copyright (c) 2013-2015 Intel, Inc. All rights reserved * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -1281,7 +1281,7 @@ static int parse_port_name(const char *port_name, ptr++; /* convert the RML tag */ - sscanf(ptr,"%d", &tag); + (void)sscanf(ptr,"%d", &tag); /* now split out the second field - the uri of the remote proc */ if (NULL == (ptr = strchr(tmpstring, '+'))) { diff --git a/opal/util/net.c b/opal/util/net.c index ecbb0db835..5765c913b0 100644 --- a/opal/util/net.c +++ b/opal/util/net.c @@ -12,7 +12,7 @@ * Copyright (c) 2007 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2013 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -162,7 +162,7 @@ opal_net_init(void) for( i = 0; i < count; i++ ) { arg = args[i]; - sscanf( arg, "%u.%u.%u.%u/%u", &a, &b, &c, &d, &bits ); + (void)sscanf( arg, "%u.%u.%u.%u/%u", &a, &b, &c, &d, &bits ); if( (a > 255) || (b > 255) || (c > 255) || (d > 255) || (bits > 32) ) { diff --git a/orte/mca/oob/tcp/oob_tcp_connection.c b/orte/mca/oob/tcp/oob_tcp_connection.c index 9bd5ae80df..baf21d4ead 100644 --- a/orte/mca/oob/tcp/oob_tcp_connection.c +++ b/orte/mca/oob/tcp/oob_tcp_connection.c @@ -1032,14 +1032,14 @@ static bool tcp_peer_recv_blocking(mca_oob_tcp_peer_t* peer, int sd, "%s connect ack received error %s from %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), strerror(opal_socket_errno), - (NULL == peer) ? "UNKNOWN" : ORTE_NAME_PRINT(&(peer->name))); + ORTE_NAME_PRINT(&(peer->name))); return false; } else { opal_output(0, "%s tcp_peer_recv_blocking: " "recv() failed for %s: %s (%d)\n", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - (NULL == peer) ? "UNKNOWN" : ORTE_NAME_PRINT(&(peer->name)), + ORTE_NAME_PRINT(&(peer->name)), strerror(opal_socket_errno), opal_socket_errno); peer->state = MCA_OOB_TCP_FAILED; diff --git a/orte/mca/plm/base/plm_base_receive.c b/orte/mca/plm/base/plm_base_receive.c index 6a45e848f9..b5f1cef569 100644 --- a/orte/mca/plm/base/plm_base_receive.c +++ b/orte/mca/plm/base/plm_base_receive.c @@ -221,9 +221,9 @@ void orte_plm_base_recv(int status, orte_process_name_t* sender, } else { jdata->bookmark = parent->bookmark; } + /* provide the parent's last object */ + jdata->bkmark_obj = parent->bkmark_obj; } - /* provide the parent's last object */ - jdata->bkmark_obj = parent->bkmark_obj; /* launch it */ OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output, diff --git a/orte/mca/ras/simulator/ras_sim_module.c b/orte/mca/ras/simulator/ras_sim_module.c index 2cbf8e22b3..febffd7ede 100644 --- a/orte/mca/ras/simulator/ras_sim_module.c +++ b/orte/mca/ras/simulator/ras_sim_module.c @@ -302,7 +302,11 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes) if (NULL != node_cnt) { opal_argv_free(node_cnt); } - +#if OPAL_HAVE_HWLOC + if (NULL != topos) { + opal_argv_free(topos); + } +#endif return ORTE_SUCCESS; error_silent: