From patchwork Fri Apr 1 18:37:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 682231 X-Patchwork-Delegate: alexne@voltaire.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p31IbRkq004135 for ; Fri, 1 Apr 2011 18:37:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751000Ab1DAShe (ORCPT ); Fri, 1 Apr 2011 14:37:34 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:34774 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750706Ab1DAShe (ORCPT ); Fri, 1 Apr 2011 14:37:34 -0400 Received: by mail-fx0-f46.google.com with SMTP id 17so2795044fxm.19 for ; Fri, 01 Apr 2011 11:37:32 -0700 (PDT) Received: by 10.223.6.11 with SMTP id 11mr4617947fax.98.1301683052168; Fri, 01 Apr 2011 11:37:32 -0700 (PDT) Received: from [192.168.1.103] (c-75-69-247-31.hsd1.ma.comcast.net [75.69.247.31]) by mx.google.com with ESMTPS id 21sm860447fav.41.2011.04.01.11.37.30 (version=SSLv3 cipher=OTHER); Fri, 01 Apr 2011 11:37:31 -0700 (PDT) Message-ID: <4D961B68.80509@dev.mellanox.co.il> Date: Fri, 01 Apr 2011 14:37:28 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma@vger.kernel.org" Subject: [PATCH 2/11] opensm/osm_pkey_mgr.c: Move clearing of empty_block after any "early" returns 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 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Apr 2011 18:37:35 +0000 (UTC) diff --git a/opensm/osm_pkey_mgr.c b/opensm/osm_pkey_mgr.c index 612130c..ce50f27 100644 --- a/opensm/osm_pkey_mgr.c +++ b/opensm/osm_pkey_mgr.c @@ -263,12 +263,12 @@ static int pkey_mgr_update_port(osm_log_t * p_log, osm_sm_t * sm, ib_pkey_table_t empty_block; int ret = 0; - memset(&empty_block, 0, sizeof(ib_pkey_table_t)); - p_physp = p_port->p_physp; if (!p_physp) return FALSE; + memset(&empty_block, 0, sizeof(ib_pkey_table_t)); + p_node = osm_physp_get_node_ptr(p_physp); p_pkey_tbl = &p_physp->pkeys;