diff mbox

[opensm] osm_trap_rcv.c: fix crash in babbling port feature

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

Commit Message

Hal Rosenstock June 24, 2013, 1:58 p.m. UTC
From: Alex Netes <alexne@mellanox.com>

Port number should be less than number of ports (and never equal to).

Found-by: Moawya Wahdan <mwahdan@asaltech.com>
Signed-off-by: Alex Netes <alexne@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 opensm/osm_trap_rcv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/opensm/osm_trap_rcv.c b/opensm/osm_trap_rcv.c
index 5682679..df222de 100644
--- a/opensm/osm_trap_rcv.c
+++ b/opensm/osm_trap_rcv.c
@@ -91,7 +91,7 @@  static osm_physp_t *get_physp_by_lid_and_num(IN osm_sm_t * sm,
 	if (!p_port)
 		return NULL;
 
-	if (osm_node_get_num_physp(p_port->p_node) < num)
+	if (osm_node_get_num_physp(p_port->p_node) <= num)
 		return NULL;
 
 	return osm_node_get_physp_ptr(p_port->p_node, num);