From: Dan Ben Yosef <da...@dev.mellanox.co.il>

Dereferencing a null pointer "remote_node"

Signed-off-by: Dan Ben Yosef <da...@dev.mellanox.co.il>
Signed-off-by: Jens Domke <domke.j...@m.titech.ac.jp>
---
 opensm/osm_ucast_dfsssp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/opensm/osm_ucast_dfsssp.c b/opensm/osm_ucast_dfsssp.c
index 013bad4..af1b062 100644
--- a/opensm/osm_ucast_dfsssp.c
+++ b/opensm/osm_ucast_dfsssp.c
@@ -815,7 +815,7 @@ static int update_channel_dep_graph(cdg_node_t ** cdg_root,
                    osm_node_get_remote_node(local_node, local_port,
                                             &remote_port);
                /* if remote_node is a Hca, then the last channel from switch 
to Hca would be a sink in the cdg -> skip */
-               if (!remote_node->sw)
+               if (!remote_node || !remote_node->sw)
                        break;
                remote_lid = cl_ntoh16(osm_node_get_base_lid(remote_node, 0));
 
@@ -961,7 +961,7 @@ static int remove_path_from_cdg(cdg_node_t ** cdg_root, 
osm_port_t * src_port,
                    osm_node_get_remote_node(local_node, local_port,
                                             &remote_port);
                /* if remote_node is a Hca, then the last channel from switch 
to Hca would be a sink in the cdg -> skip */
-               if (!remote_node->sw)
+               if (!remote_node || !remote_node->sw)
                        break;
                remote_lid = cl_ntoh16(osm_node_get_base_lid(remote_node, 0));
 
-- 
1.7.1

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

Reply via email to