infiniband-diags: umad_init needs to be called before sa_get_handle
PATCH 1/1 infiniband-diags: umad_init needs to be called before sa_get_handle
Signed-off-by Ira Weiny <[email protected]>
--- include/ibdiag_sa.h | 1 + src/saquery.c | 4 ++++ 2 files changed, 5 insertions(+), 0 deletions(-)
include/ibdiag_sa.h +1 -0
@@ -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
@@ -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