diff mbox

opensm: don't set switch hops to lid 0

Message ID 20110627170803.GB17645@calypso.voltaire.com (mailing list archive)
State Accepted
Headers show

Commit Message

Alex Netes June 27, 2011, 5:08 p.m. UTC
Some faulty switches, may retuen port_info.base_lid=0.
This patch fixes a crash in a multicast engine, caused by lid matrix
with hops values for lid 0.

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

Patch

diff --git a/opensm/osm_switch.c b/opensm/osm_switch.c
index fbb8292..a625b2c 100644
--- a/opensm/osm_switch.c
+++ b/opensm/osm_switch.c
@@ -54,7 +54,7 @@ 
 cl_status_t osm_switch_set_hops(IN osm_switch_t * p_sw, IN uint16_t lid_ho,
 				IN uint8_t port_num, IN uint8_t num_hops)
 {
-	if (lid_ho > p_sw->max_lid_ho)
+	if (!lid_ho || lid_ho > p_sw->max_lid_ho)
 		return -1;
 	if (!p_sw->hops[lid_ho]) {
 		p_sw->hops[lid_ho] = malloc(p_sw->num_ports);