[ofa-general] [PATCH] OpenSM/osm_mcast_mgr.c: Possible NULL ptr seg fault

Hal Rosenstock hrosenstock at xsigo.com
Wed Sep 19 06:00:46 PDT 2007


In osm_mcast_mgr.c:__osm_mcast_mgr_branch, protect against NULL return
from osm_node_get_remote_node

Signed-off-by: Hal Rosenstock <hal at xsigo.com>

diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c
index 0fad02b..50b95fd 100644
--- a/opensm/opensm/osm_mcast_mgr.c
+++ b/opensm/opensm/osm_mcast_mgr.c
@@ -765,6 +765,8 @@ static osm_mtree_node_t *__osm_mcast_mgr_branch(osm_mcast_mgr_t * const p_mgr,
 
 		p_node = p_sw->p_node;
 		p_remote_node = osm_node_get_remote_node(p_node, i, NULL);
+		if (!p_remote_node)
+			continue;
 
 		if (osm_node_get_type(p_remote_node) == IB_NODE_TYPE_SWITCH) {
 			/*




More information about the general mailing list