diff mbox

[opensm] opensm/osm_db_pack.c: Removed uneeded asserts

Message ID 51EE9E6F.8000402@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Hal Rosenstock July 23, 2013, 3:17 p.m. UTC
From: Alex Netes <alexne@mellanox.com>

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

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

Patch

diff --git a/opensm/osm_db_pack.c b/opensm/osm_db_pack.c
index 708a875..8cddd06 100644
--- a/opensm/osm_db_pack.c
+++ b/opensm/osm_db_pack.c
@@ -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;