Skip to contentSkip to conversation

ibacm/acm.c: Make sure shift for subnet timeout is not negative

PATCH In review Hal Rosenstock 2 participants 2 messages May 30, 2012 – May 31, 2012 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibacm/acm.c: Make sure shift for subnet timeout is not negative

in acm_port_up

---

src/acm.c +2 -1
index b47ee8a..c40f079 100644
@@ -2794,7 +2794,8 @@ static void acm_port_up(struct acm_port *port)
 
 	port->mtu = attr.active_mtu;
 	port->rate = acm_get_rate(attr.active_width, attr.active_speed);
-	port->subnet_timeout = 1 << (attr.subnet_timeout - 8);
+	if (attr.subnet_timeout >= 8)
+		port->subnet_timeout = 1 << (attr.subnet_timeout - 8);
 	for (port->gid_cnt = 0;; port->gid_cnt++) {
 		ret = ibv_query_gid(port->dev->verbs, port->port_num, port->gid_cnt, &gid);
 		if (ret || !gid.global.interface_id)

--
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

A message that is not in the archive (sent off-list or not yet received): 4FC69196.9070200-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org