Skip to contentSkip to conversation

infiniband-diags/ibqueryerrors: Properly exit and clean up resources when node info query fails

PATCH Applied Ira Weiny 2 participants 2 messages Nov 4, 2009 – Nov 13, 2009 1 message not in the archive InfiniBand

lore
Share & tools
lore

Ira Weiny

author
#0 lore raw

PATCH 2/2 infiniband-diags/ibqueryerrors: Properly exit and clean up resources when node info query fails

From: Ira Weiny <[email protected]>
Date: Tue, 3 Nov 2009 20:17:14 -0800
Subject: [PATCH] infiniband-diags/ibqueryerrors: Properly exit and clean up resources when node info query fails

---
 infiniband-diags/src/ibqueryerrors.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
infiniband-diags/src/ibqueryerrors.c +5 -2
index 43698d2..8305e5d 100644
@@ -559,8 +559,10 @@ int main(int argc, char **argv)
 		uint8_t ni[IB_SMP_DATA_SIZE];
 
 		if (!smp_query_via(ni, &portid, IB_ATTR_NODE_INFO, 0,
-				   ibd_timeout, ibmad_port))
-			return -1;
+				   ibd_timeout, ibmad_port)) {
+			rc = -1;
+			goto destroy_fabric;
+		}
 		mad_decode_field(ni, IB_NODE_GUID_F, &(node_guid));
 
 		node = ibnd_find_node_guid(fabric, node_guid);
@@ -571,6 +573,7 @@ int main(int argc, char **argv)
 	} else
 		ibnd_iter_nodes(fabric, print_node, NULL);
 
+destroy_fabric:
 	ibnd_destroy_fabric(fabric);
 
 close_port:
Signature · 6 lines
1.5.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 7 lines · Ira Weiny

From: Ira Weiny <[email protected]>
Date: Tue, 3 Nov 2009 20:17:14 -0800
Subject: [PATCH] infiniband-diags/ibqueryerrors: Properly exit and clean up resources when node info query fails

Applied. Thanks.

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html