From patchwork Tue Apr 5 18:04:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 688411 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 p35I58rs021414 for ; Tue, 5 Apr 2011 18:05:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753303Ab1DESFH (ORCPT ); Tue, 5 Apr 2011 14:05:07 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:39568 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752546Ab1DESFG (ORCPT ); Tue, 5 Apr 2011 14:05:06 -0400 Received: by fxm17 with SMTP id 17so454033fxm.19 for ; Tue, 05 Apr 2011 11:05:04 -0700 (PDT) Received: by 10.223.77.19 with SMTP id e19mr1109126fak.36.1302026704035; Tue, 05 Apr 2011 11:05:04 -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 n9sm2174670fax.27.2011.04.05.11.05.01 (version=SSLv3 cipher=OTHER); Tue, 05 Apr 2011 11:05:02 -0700 (PDT) Message-ID: <4D9B59CB.9080102@dev.mellanox.co.il> Date: Tue, 05 Apr 2011 14:04:59 -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 1/2] opensm/osm_pkey_mgr.c: In pkey_mgr_update_peer_port, initialize p_peer_pkey_tbl later in flow 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]); Tue, 05 Apr 2011 18:05:09 +0000 (UTC) Closer to where initially used 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_pkey_mgr.c b/opensm/osm_pkey_mgr.c index 92f8f2b..78e8f83 100644 --- a/opensm/osm_pkey_mgr.c +++ b/opensm/osm_pkey_mgr.c @@ -402,7 +402,6 @@ static int pkey_mgr_update_peer_port(osm_log_t * p_log, osm_sm_t * sm, return 0; p_pkey_tbl = osm_physp_get_pkey_tbl(p_physp); - p_peer_pkey_tbl = &peer->pkeys; peer_max_blocks = pkey_mgr_get_physp_max_blocks(peer); if (peer_max_blocks < p_pkey_tbl->used_blocks) { OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0508: " @@ -424,6 +423,7 @@ static int pkey_mgr_update_peer_port(osm_log_t * p_log, osm_sm_t * sm, memset(&empty_block, 0, sizeof(ib_pkey_table_t)); + p_peer_pkey_tbl = &peer->pkeys; p_peer_pkey_tbl->used_blocks = p_pkey_tbl->used_blocks; for (block_index = 0; block_index < p_pkey_tbl->used_blocks; block_index++) {