From patchwork Fri Jun 3 00:40:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 845362 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 p530eUUR010560 for ; Fri, 3 Jun 2011 00:40:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754472Ab1FCAkb (ORCPT ); Thu, 2 Jun 2011 20:40:31 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:61463 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754385Ab1FCAkb (ORCPT ); Thu, 2 Jun 2011 20:40:31 -0400 Received: by mail-ww0-f44.google.com with SMTP id 36so1160181wwa.1 for ; Thu, 02 Jun 2011 17:40:30 -0700 (PDT) Received: by 10.216.71.136 with SMTP id r8mr3094904wed.0.1307061630612; Thu, 02 Jun 2011 17:40:30 -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 b10sm706553wbh.9.2011.06.02.17.40.28 (version=SSLv3 cipher=OTHER); Thu, 02 Jun 2011 17:40:29 -0700 (PDT) Message-ID: <4DE82D7B.1090408@dev.mellanox.co.il> Date: Thu, 02 Jun 2011 20:40:27 -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: Handle [sw hca]_create failures 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]); Fri, 03 Jun 2011 00:40:32 +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..477f883 100644 --- a/opensm/osm_ucast_ftree.c +++ b/opensm/osm_ucast_ftree.c @@ -2,7 +2,7 @@ * Copyright (c) 2009 Simula Research Laboratory. All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two @@ -1050,10 +1050,14 @@ static uint8_t fabric_get_rank(ftree_fabric_t * p_ftree) static void fabric_add_hca(ftree_fabric_t * p_ftree, osm_node_t * p_osm_node) { - ftree_hca_t *p_hca = hca_create(p_osm_node); + ftree_hca_t *p_hca; CL_ASSERT(osm_node_get_type(p_osm_node) == IB_NODE_TYPE_CA); + p_hca = hca_create(p_osm_node); + if (!p_hca) + return; + cl_qmap_insert(&p_ftree->hca_tbl, p_osm_node->node_info.node_guid, &p_hca->map_item); } @@ -1062,10 +1066,14 @@ static void fabric_add_hca(ftree_fabric_t * p_ftree, osm_node_t * p_osm_node) static void fabric_add_sw(ftree_fabric_t * p_ftree, osm_switch_t * p_osm_sw) { - ftree_sw_t *p_sw = sw_create(p_ftree, p_osm_sw); + ftree_sw_t *p_sw; CL_ASSERT(osm_node_get_type(p_osm_sw->p_node) == IB_NODE_TYPE_SWITCH); + p_sw = sw_create(p_ftree, p_osm_sw); + if (!p_sw) + return; + cl_qmap_insert(&p_ftree->sw_tbl, p_osm_sw->p_node->node_info.node_guid, &p_sw->map_item);