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 <[email protected]> --- opensm/osm_switch.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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); -- 1.7.5.4 -- Alex -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
