Skip to contentSkip to conversation

opensm/osm_db_pack.c: Removed uneeded asserts

PATCH New Hal Rosenstock 1 participant 1 message Jul 23, 2013 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opensm/osm_db_pack.c: Removed uneeded asserts

From: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/[email protected]>

Out of range lids isn't a fatal event and SM code just ignores these lids.

---
 opensm/osm_db_pack.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
opensm/osm_db_pack.c +6 -2
index 708a875..8cddd06 100644
@@ -73,14 +73,18 @@ static inline int unpack_lids(IN char *p_lid_str, OUT uint16_t * p_min_lid,
 	if (!p_num)
 		return 1;
 	tmp = strtoul(p_num, NULL, 0);
-	CL_ASSERT(tmp < 0x10000);
+	if (tmp >= 0xC000)
+		return 1;
+
 	*p_min_lid = (uint16_t) tmp;
 
 	p_num = strtok_r(NULL, " \t", &p_next);
 	if (!p_num)
 		return 1;
 	tmp = strtoul(p_num, NULL, 0);
-	CL_ASSERT(tmp < 0x10000);
+	if (tmp >= 0xC000)
+		return 1;
+
 	*p_max_lid = (uint16_t) tmp;
 
 	return 0;
Signature · 6 lines
1.7.8.2

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