From patchwork Tue May 31 11:30:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 832142 X-Patchwork-Delegate: alexne@voltaire.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4VBUEZ8005324 for ; Tue, 31 May 2011 11:30:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752666Ab1EaLaN (ORCPT ); Tue, 31 May 2011 07:30:13 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:50329 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752488Ab1EaLaN (ORCPT ); Tue, 31 May 2011 07:30:13 -0400 Received: by wwa36 with SMTP id 36so4761009wwa.1 for ; Tue, 31 May 2011 04:30:11 -0700 (PDT) Received: by 10.227.60.206 with SMTP id q14mr6026727wbh.111.1306841411805; Tue, 31 May 2011 04:30:11 -0700 (PDT) Received: from [192.168.1.100] (c-71-192-10-85.hsd1.ma.comcast.net [71.192.10.85]) by mx.google.com with ESMTPS id 14sm3678712wbw.49.2011.05.31.04.30.09 (version=SSLv3 cipher=OTHER); Tue, 31 May 2011 04:30:10 -0700 (PDT) Message-ID: <4DE4D13F.6050702@dev.mellanox.co.il> Date: Tue, 31 May 2011 07:30:07 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma@vger.kernel.org" Subject: [PATCH] opensm/osm_ucast_ftree.c: Fix some issues found by Coverity Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 31 May 2011 11:30:14 +0000 (UTC) Signed-off-by: Hal Rosenstock --- -- 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 --git a/opensm/osm_ucast_ftree.c b/opensm/osm_ucast_ftree.c index 51e252a..e7e7b8e 100644 --- a/opensm/osm_ucast_ftree.c +++ b/opensm/osm_ucast_ftree.c @@ -3281,7 +3281,7 @@ fabric_construct_hca_ports(IN ftree_fabric_t * p_ftree, IN ftree_hca_t * p_hca) p_remote_node = osm_node_get_remote_node(p_node, i, &remote_port_num); - if (!p_remote_osm_port) + if (!p_remote_osm_port || !p_remote_node) continue; remote_node_type = osm_node_get_type(p_remote_node); @@ -3420,6 +3420,8 @@ static int fabric_construct_sw_ports(IN ftree_fabric_t * p_ftree, p_remote_node = osm_node_get_remote_node(p_node, i, &remote_port_num); + if (!p_remote_node) + continue; /* ignore any loopback connection on switch */ if (p_node == p_remote_node) {