diff mbox

opensm/osm_ucast_ftree.c: Handle [sw hca]_create failures

Message ID 4DE82D7B.1090408@dev.mellanox.co.il (mailing list archive)
State Accepted
Headers show

Commit Message

Hal Rosenstock June 3, 2011, 12:40 a.m. UTC
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
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

Comments

Alex Netes June 3, 2011, 10:48 a.m. UTC | #1
On 20:40 Thu 02 Jun     , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
> ---

Applied, 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_ftree.c b/opensm/osm_ucast_ftree.c
index 51e252a..477f883 100644
--- a/opensm/osm_ucast_ftree.c
+++ b/opensm/osm_ucast_ftree.c
@@ -2,7 +2,7 @@ 
  * Copyright (c) 2009 Simula Research Laboratory. All rights reserved.
  * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
  * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -1050,10 +1050,14 @@  static uint8_t fabric_get_rank(ftree_fabric_t * p_ftree)
 
 static void fabric_add_hca(ftree_fabric_t * p_ftree, osm_node_t * p_osm_node)
 {
-	ftree_hca_t *p_hca = hca_create(p_osm_node);
+	ftree_hca_t *p_hca;
 
 	CL_ASSERT(osm_node_get_type(p_osm_node) == IB_NODE_TYPE_CA);
 
+	p_hca = hca_create(p_osm_node);
+	if (!p_hca)
+		return;
+
 	cl_qmap_insert(&p_ftree->hca_tbl, p_osm_node->node_info.node_guid,
 		       &p_hca->map_item);
 }
@@ -1062,10 +1066,14 @@  static void fabric_add_hca(ftree_fabric_t * p_ftree, osm_node_t * p_osm_node)
 
 static void fabric_add_sw(ftree_fabric_t * p_ftree, osm_switch_t * p_osm_sw)
 {
-	ftree_sw_t *p_sw = sw_create(p_ftree, p_osm_sw);
+	ftree_sw_t *p_sw;
 
 	CL_ASSERT(osm_node_get_type(p_osm_sw->p_node) == IB_NODE_TYPE_SWITCH);
 
+	p_sw = sw_create(p_ftree, p_osm_sw);
+	if (!p_sw)
+		return;
+
 	cl_qmap_insert(&p_ftree->sw_tbl, p_osm_sw->p_node->node_info.node_guid,
 		       &p_sw->map_item);