Use IBPANIC consistently in libibnetdisc, in particular, since IBPANIC calls exit, there's no use in returning a value after an error.
Al -- Albert Chu [email protected] Computer Scientist High Performance Systems Division Lawrence Livermore National Laboratory
From: Albert Chu <[email protected]> Date: Thu, 23 Jul 2009 11:57:35 -0700 Subject: [PATCH] Use IBPANIC consistently in libibnetdisc, in particular, since IBPANIC calls exit, there's no use in returning a value after an error. Signed-off-by: Albert Chu <[email protected]> --- infiniband-diags/libibnetdisc/src/ibnetdisc.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c index 4b90744..1f041ac 100644 --- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c @@ -369,10 +369,8 @@ create_node(struct ibnd_fabric *fabric, struct ibnd_node *temp, ib_portid_t *pat struct ibnd_node *node; node = malloc(sizeof(*node)); - if (!node) { + if (!node) IBPANIC("OOM: node creation failed\n"); - return NULL; - } memcpy(node, temp, sizeof(*node)); node->node.dist = dist; @@ -530,10 +528,8 @@ ibnd_discover_fabric(struct ibmad_port *ibmad_port, int timeout_ms, fabric = malloc(sizeof(*fabric)); - if (!fabric) { + if (!fabric) IBPANIC("OOM: failed to malloc ibnd_fabric_t\n"); - return (NULL); - } memset(fabric, 0, sizeof(*fabric)); -- 1.5.4.5
_______________________________________________ general mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
