Sasha,

I actually hit these when I was testing with a low OSM_UMAD_MAX_PENDING value.
I was a bit unsure of what to do in these cases if p_physp was NULL.  What I do
in this patch seems reasonable as the fabric does route but perhaps you could
double check me?

Thanks,
Ira


>From 310a6cceca946fcc86f7bec28dfdeba77d011fc5 Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <[EMAIL PROTECTED]>
Date: Wed, 20 Feb 2008 13:53:51 -0800
Subject: [PATCH] Fix 2 potential core dumps now that osm_node_get_physp_ptr can 
return NULL


Signed-off-by: Ira K. Weiny <[EMAIL PROTECTED]>
---
 opensm/opensm/osm_node.c       |    2 ++
 opensm/opensm/osm_ucast_updn.c |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/opensm/opensm/osm_node.c b/opensm/opensm/osm_node.c
index 85ea3c9..843f7c8 100644
--- a/opensm/opensm/osm_node.c
+++ b/opensm/opensm/osm_node.c
@@ -285,6 +285,8 @@ osm_node_t *osm_node_get_remote_node(IN osm_node_t * const 
p_node,
        osm_physp_t *p_remote_physp;
 
        p_physp = osm_node_get_physp_ptr(p_node, port_num);
+       if (!p_physp)
+               return (NULL);
 
        if (!osm_physp_has_any_link(p_physp))
                return (NULL);
diff --git a/opensm/opensm/osm_ucast_updn.c b/opensm/opensm/osm_ucast_updn.c
index 76b94cb..a7d61aa 100644
--- a/opensm/opensm/osm_ucast_updn.c
+++ b/opensm/opensm/osm_ucast_updn.c
@@ -377,6 +377,10 @@ updn_subn_rank(IN unsigned num_guids,
                        /* Current port fetched in order to get remote side */
                        p_physp =
                            osm_node_get_physp_ptr(p_sw->p_node, port_num);
+
+                       if (!p_physp)
+                               continue;
+
                        p_remote_physp = p_physp->p_remote_physp;
 
                        /*
-- 
1.5.1

Attachment: 0002-Fix-2-potential-core-dumps-now-that-osm_node_get_phy.patch
Description: Binary data

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to