[ofa-general] [infiniband-diags] [PATCH] [2/6] fix libibnetdisc API consistency and bugs
Al Chu
chu11 at llnl.gov
Mon Jul 27 10:12:36 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: Albert Chu <chu11 at llnl.gov>
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 <chu11 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 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
More information about the general
mailing list