Skip to contentSkip to conversation

infiniband-diags: umad_init needs to be called before sa_get_handle

PATCH New Ira Weiny 1 participant 1 message Jul 5, 2013 InfiniBand

lore
Share & tools
lore

Ira Weiny

author
#0 lore raw

PATCH 1/1 infiniband-diags: umad_init needs to be called before sa_get_handle

---
 include/ibdiag_sa.h |    1 +
 src/saquery.c       |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
include/ibdiag_sa.h +1 -0
index 41b4a4c..368a829 100644
@@ -58,6 +58,7 @@ struct sa_query_result {
 	void *p_result_madw;
 };
 
+/* NOTE: umad_init must be called prior to sa_get_handle */
 struct sa_handle * sa_get_handle(void);
 void sa_free_handle(struct sa_handle * h);
 
src/saquery.c +4 -0
index 2ee29ad..b27686b 100644
@@ -1842,6 +1842,9 @@ int main(int argc, char **argv)
 		ibdiag_show_usage();
 	}
 
+	if (umad_init())
+		IBERROR("Failed to initialized umad library");
+
 	h = sa_get_handle();
 	if (!h)
 		IBPANIC("Failed to bind to the SA");
@@ -1894,6 +1897,7 @@ error:
 	if (src_lid)
 		free(src_lid);
 	sa_free_handle(h);
+	umad_done();
 	close_node_name_map(node_name_map);
 	return (status);
 }
Signature · 6 lines
1.7.1

--
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