diff mbox

opensm/osm_req.c: fix first sweep m_key search algorithm

Message ID 1360078444-4835-1-git-send-email-alexne@mellanox.com (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Alex Netes Feb. 5, 2013, 3:34 p.m. UTC
During the first sweep we don't have yet dest physp object

Signed-off-by: Alex Netes <alexne@mellanox.com>
---
 opensm/osm_req.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/opensm/osm_req.c b/opensm/osm_req.c
index 8ec4ac6..f9ffc81 100644
--- a/opensm/osm_req.c
+++ b/opensm/osm_req.c
@@ -93,7 +93,7 @@  static ib_net64_t req_determine_mkey(IN osm_sm_t * sm,
 		p_physp = p_sm_port->p_physp;
 	}
 
-	for (hop = 1; p_physp && hop <= p_path->hop_count; hop++) {
+	for (hop = 1; p_physp && hop < p_path->hop_count; hop++) {
 		p_physp = osm_node_get_physp_ptr(p_node, p_path->path[hop]);
 		if (!p_physp)
 			break;
@@ -103,6 +103,8 @@  static ib_net64_t req_determine_mkey(IN osm_sm_t * sm,
 		p_node = osm_physp_get_node_ptr(p_physp);
 	}
 
+	p_physp = osm_node_get_physp_ptr(p_node, p_path->path[hop]);
+
 	/* At this point, p_physp points at the outgoing physp on the
 	   last hop, or NULL if we don't know it.
 	*/