* [PATCH 2/2] infiniband-diags/ibqueryerrors: Properly exit and clean up resources when node info query fails
@ 2009-11-04 4:22 Ira Weiny
[not found] ` <20091103202247.901acbda.weiny2-i2BcT+NCU+M@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Ira Weiny @ 2009-11-04 4:22 UTC (permalink / raw)
To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
From: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
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
Signed-off-by: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
---
infiniband-diags/src/ibqueryerrors.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/infiniband-diags/src/ibqueryerrors.c b/infiniband-diags/src/ibqueryerrors.c
index 43698d2..8305e5d 100644
--- a/infiniband-diags/src/ibqueryerrors.c
+++ b/infiniband-diags/src/ibqueryerrors.c
@@ -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:
--
1.5.4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-13 5:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-04 4:22 [PATCH 2/2] infiniband-diags/ibqueryerrors: Properly exit and clean up resources when node info query fails Ira Weiny
[not found] ` <20091103202247.901acbda.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-11-13 5:59 ` Sasha Khapyorsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox