[ofa-general] [infiniband-diags] [PATCH] [5/5] libibnetdisc cleanup patches
Al Chu
chu11 at llnl.gov
Tue Jul 7 15:25:11 PDT 2009
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
chu11 at llnl.gov
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
-------------- next part --------------
>From ee8a77441551a94890fd6c553bb608510579abff Mon Sep 17 00:00:00 2001
From: Albert Chu <chu11 at 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 <chu11 at llnl.gov>
Signed-off-by: Ira Weiny <weiny2 at 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
More information about the general
mailing list