diff mbox

opensm/osm_node_info_rcv.c: In ni_rcv_process_existing_ca_or_router, handle error

Message ID 4FFEF9EA.4060006@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Hal Rosenstock July 12, 2012, 4:23 p.m. UTC
Add handling for case where osm_node_get_physp_ptr returns NULL pointer

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Alex Netes July 25, 2012, 7:56 a.m. UTC | #1
Hi Hal,

On 12:23 Thu 12 Jul     , Hal Rosenstock wrote:
> 
> Add handling for case where osm_node_get_physp_ptr returns NULL pointer
> 
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
> ---

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/opensm/osm_node_info_rcv.c b/opensm/osm_node_info_rcv.c
index 58c92b9..293f0c8 100644
--- a/opensm/osm_node_info_rcv.c
+++ b/opensm/osm_node_info_rcv.c
@@ -479,6 +479,16 @@  alias_done:
 
 	} else {
 		osm_physp_t *p_physp = osm_node_get_physp_ptr(p_node, port_num);
+
+		if (p_physp == NULL) {
+			OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D1C: "
+				"No physical port found for node GUID 0x%"
+				PRIx64 " port %u. Might be duplicate port GUID\n",
+				cl_ntoh64(p_node->node_info.node_guid),
+				port_num);
+			goto Exit;
+		}
+
 		/*
 		   Update the DR Path to the port,
 		   in case the old one is no longer available.