diff mbox

[01/10] DFSSSP: fix a memory leak in dfsssp_build_graph

Message ID 1358872698-16850-1-git-send-email-domke.j.aa@m.titech.ac.jp (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Jens Domke Jan. 22, 2013, 4:38 p.m. UTC
If the graph could not be build correctly and DFSSSP returns an error, then not all allocated memory was freed.

Signed-off-by: Jens Domke <domke.j.aa@m.titech.ac.jp>
---
 opensm/osm_ucast_dfsssp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Alex Netes Feb. 3, 2013, 5:51 p.m. UTC | #1
Hi Jens,

On 01:38 Wed 23 Jan     , Jens Domke wrote:
> If the graph could not be build correctly and DFSSSP returns an error, then not all allocated memory was freed.
> 
> Signed-off-by: Jens Domke <domke.j.aa@m.titech.ac.jp>
> ---

Applied the series, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/opensm/osm_ucast_dfsssp.c b/opensm/osm_ucast_dfsssp.c
index ffc317f..ff525ea 100644
--- a/opensm/osm_ucast_dfsssp.c
+++ b/opensm/osm_ucast_dfsssp.c
@@ -1093,6 +1093,9 @@  static int dfsssp_build_graph(void *context)
 	for (i = 0; i < adj_list_size; i++)
 		set_default_vertex(&adj_list[i]);
 
+	dfsssp_ctx->adj_list = adj_list;
+	dfsssp_ctx->adj_list_size = adj_list_size;
+
 	/* count the total number of Hca / LIDs (for lmc>0) in the fabric */
 	for (item = cl_qmap_head(port_tbl); item != cl_qmap_end(port_tbl);
 	     item = cl_qmap_next(item)) {
@@ -1190,9 +1193,6 @@  static int dfsssp_build_graph(void *context)
 	if (OSM_LOG_IS_ACTIVE_V2(p_mgr->p_log, OSM_LOG_DEBUG))
 		dfsssp_print_graph(p_mgr, adj_list, adj_list_size);
 
-	dfsssp_ctx->adj_list = adj_list;
-	dfsssp_ctx->adj_list_size = adj_list_size;
-
 	OSM_LOG_EXIT(p_mgr->p_log);
 	return 0;
 }