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 ch...@llnl.gov Computer Scientist High Performance Systems Division Lawrence Livermore National Laboratory
>From ee8a77441551a94890fd6c553bb608510579abff Mon Sep 17 00:00:00 2001 From: Albert Chu <ch...@llnl.gov> Date: Tue, 7 Jul 2009 12:59:22 -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 <ch...@llnl.gov> Signed-off-by: Ira Weiny <wei...@llnl.gov> --- 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 d8bf200..ffd8602 100644 --- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c @@ -369,10 +369,8 @@ create_node(struct ibnd_fabric_int *fabric, struct ibnd_node_int *temp, ib_porti struct ibnd_node_int *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 general@lists.openfabrics.org http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general